How to close an application programmatically when a user clicks a button

I need to close the application when the user clicks the button (I need to save IBAction to close the application). As in the games menu, we have an exit button, when we click on it, we exit the game. need.How can I do this. thanks in advance

+5
source share
7 answers
+14

, , , "", UIApplicationExitsOnSuspend YES Info.plist. , , applicationWillTerminate: , .

+6

exit(0); , , , exit(0); terminate iPhone. alerview , ", , ".

+3

UIApplication *myapp = [UIApplication sharedApplication];
[myapp performSelector:@selector(suspend)];

, .

+1

API, iPhone. iPhone OS "", . .

0

, :

[[UIApplication sharedApplication] sendAction:SIGKILL to:[UIApplication sharedApplication] from:self forEvent:nil];

. UIAlertView , .

0

exit (0) , . - . , , - user.killing - . .

0

All Articles