开发者

iPhone SDK Quitting

I have found many apps where you can press a button or something similar and the application will terminate an开发者_如何学编程d bring you back to the home screen. How would I do this?


exit(0);

this can exit the app .

again, the best way I think will be like as follows:

    //@step invoke the normal routine applicationWillTerminate
if ([[UIApplication sharedApplication].delegate respondsToSelector:@selector(applicationWillTerminate:)]) 
{
    [[UIApplication sharedApplication].delegate performSelector:@selector(applicationWillTerminate:) withObject:[UIApplication sharedApplication]];
}
//@step force quite app
kill(getpid(), SIGINT); 

I got it from other post on the overflow :D


from http://www.iphonedevsdk.com/forum/iphone-sdk-development/6928-exit-application.html

[[UIApplication sharedApplication] terminateWithSuccess];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜