Search code examples
iphoneiosobjective-c

How to close an application programmatically when the user taps on a button


I need to close the application whenever user taps on the button(i need to keep IBAction for closing the app).Like in games menu we have exit button when we tap on it we come out from the game.Same thing i need.How can i do this .Thanks in advance


Solution

  • Please see: How do I programmatically quit my iPhone application?

    WARNING: It is possible to quit the application by calling exit. Applications calling exit will appear to the user to have crashed, rather than performing a graceful termination and animating back to the Home screen. Such usage provides a negative experience and is strongly discouraged.