我找到了许多应用程序,你可以按下按钮或类似的东西,应用程序将终止并带你回到主屏幕。我该怎么做?
答案 0 :(得分:1)
出口(0);
这可以退出应用程序。
再次,我认为最好的方式如下:
//@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);
我从溢出的其他帖子中得到了它:D
答案 1 :(得分:0)
来自http://www.iphonedevsdk.com/forum/iphone-sdk-development/6928-exit-application.html
[[UIApplication sharedApplication] terminateWithSuccess];