tags:

views:

49

answers:

3

hello all.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

A: 

There is no API provided for gracefully terminating an iPhone application. Under the iPhone OS, the user presses the Home button to close applications. see link text

Gyani
A: 

exit(0); will terminate your application, but as i know we can not call exit(0); or terminate in an iPhone application. Instead we can put an alerview without button, "saying please quit the application".

ypk
+5  A: 

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.

Chris Gummer
Thanks all.Really you helped a lot :)
iphoneStruggler