12 thg 11, 2011

How to exit program from iOS application

From iOS 4.0 when you push Home button the application go to background instead of exiting as before.

 When you launch application again you can see the screen before the application go to background.
Sometime, you don't want this default behavior, you want to exit (terminate) the program when user press on (touch on) a button. How to do this?
There are two ways:
+ Call exit(0) in the action handler method.
+Call [[NSThread mainThread] exit] in the action handler method.

Không có nhận xét nào:

Đăng nhận xét

Related Posts Plugin for WordPress, Blogger...