After some tests, I can say the following:
- using the private interface :
[UIApplication sharedApplication]will cause the app looking like it crashed, BUT it will call- (void)applicationWillTerminate:(UIApplication *)applicationbefore doing so; - using
exit(0);will also terminate the application, but it will look "normal" (the springboard's icons appears like expected, with the zoom out effect), BUT it won't call the- (void)applicationWillTerminate:(UIApplication *)applicationdelegate method.
My advice:
- Manually call the
- (void)applicationWillTerminate:(UIApplication *)applicationon the delegate. - Call
exit(0);.
推薦使用=> exit(0);
要讓用戶死的明白~
可以用~ => UIAlertView警告他之後再... 自爆~
reference : Stack Overflow
reference : Stack Overflow
沒有留言:
張貼留言