开发者

Remotely Closing the App

开发者_C百科

I have a button in my UI and was wondering if you are able to close the app and exit to the homescreen if you press it. Thanks!


You can always call exit(0) but it is against Apple's design guidelines to close applications programatically. The recommended way is when the user press the home button.


I don't know your thoughts for doing this, but try explaining why or at least think it over again :)

A snippet from the HIG

iPhone applications should never quit programmatically because doing so looks like a crash to the user. There may be times, however, when external circumstances prevent your application from functioning as intended. The best way to handle this is to display an attractive screen that describes the problem and suggests how users can correct it. This helps users in two ways: ■ It provides feedback that reassures users that there’s nothing wrong with your application ■ It puts users in control, letting them decide whether they want to take corrective action and continue using your application or press the Home button and open a different application


This method works also [[UIApplication sharedApplication] terminateWithSuccess];, but as mentioned shouldn't be used for distribution on the AppStore.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜