Quit the application in iphone by code
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3869679/how-to-quit-exit-an-app-in-iphone4-sdk">how to quit (exit) an app in iPhone4 sdk</a>  </p>
</blockquote>



<p>I have a close button in the first view of the app. I need to close the application succesfully on button click. I had tried the two cases but not worked.</p>

<ol>
<li><code>[[UIApplication sharedApplication] terminate];</code></li>
<li><code>[[UIApplication sharedApplication] exit(0)];</code></li>
</ol>
