条件退出(0);在applicationDidEnterBackground中?

时间:2013-03-25 14:21:53

标签: iphone xcode exit

是否可以使用exit(0);像这样?

-(void)applicationDidEnterBackground:(UIApplication *)application
{
     if (UserDontWantItRunInBackground) {
        exit(0);
     }
}

Apple会批准吗?

1 个答案:

答案 0 :(得分:2)

我的理解是,Apple根本不喜欢你使用exit()

确实,来自Apple的Human Interface Guidelines

Don’t Quit Programmatically

Never quit an iOS app programmatically because people tend to interpret this as a crash. 

据我所知,虽然它可能与您的预期完全一致,但您的应用很可能会遭到拒绝。