Proper way to exit iPhone application?
Solution 1:
On the iPhone there is no concept of quitting an app. The only action that should cause an app to quit is touching the Home button on the phone, and that's not something developers have access to.
According to Apple, your app should not terminate on its own. Since the user did not hit the Home button, any return to the Home screen gives the user the impression that your app crashed. This is confusing, non-standard behavior and should be avoided.
Solution 2:
Have you tried exit(0)
?
Alternatively, [[NSThread mainThread] exit]
, although I have not tried that it seems like the more appropriate solution.