Using exit(0); in iphone app
Will the a开发者_Go百科pplication get rejected if we use exit(0); in our application?
Calling exit(0)
will send the application to the background, but such action should only be initiated by the user. From Technical Q&A QA1561 How do I programmatically quit my iPhone application?.
There is no API provided for gracefully terminating an iPhone application. Under the iPhone OS, the user presses the Home button to close applications. Should your application have conditions in which it cannot provide its intended function, the recommended approach is to display an alert for the user that indicates the nature of the problem and possible actions the user could take - turning on WiFi, enabling Location Services, etc. Allow the user to terminate the application at their own discretion.
One of my application got rejected due to this. So Don't dare to try it. Its out of HIG.
Please search before you ask questions..See this , this , this, this ...All from stackoverflow..Also look at apple's QA where apple strongly discourage quiting app by program..
精彩评论