Exit the application or go to the control panel (main page) programmatically - IOS

I want to exit the application programmatically, I googled, some people suggest using exit (1), but apple does not support this, I think. If so, how do I exit the application. Any help is appreciated.

+4
source share
4 answers

exit(0); will work but not use it

You do not have to force close the application, as the standard way to end the application is to press the home button (or use the multitasking panel).

Dont quit programmatically


Never leave an iOS application programmatically, because people tend to interpret this as a crash. However, if external circumstances prevent your application from working properly, you need to inform users about the situation and explain what they can do about it. Depending on how serious the malfunction of the application is, you have two choices.

Show an attractive screen that describes the problem and offers a correction. . The screen provides feedback that convinces users that there is nothing wrong with your application. This puts users in control, allowing them to decide whether they want to take corrective actions and continue to use the application or click the "Home" button and open the various application

If only some of your application features do not work, either a screen or a warning when people activate this feature. Display a warning only when people try to access a function that is not functioning.

A source

+15
source

I believe that you are not reading the comment correctly, so send an answer to ur here: "Just do not do this, because the apple does not allow the application to crash like that."

look here. How to exit my iOS application gracefully after processing a local notification and here to exit the iOS 4.0 application a discussion of tariffs here.

+2
source

After the release of iOS4, multitasking (new feature) was added by APPLE. This feature allowed users to keep the application in a paused state in the background if it had to perform some other actions between them (for example, receive a phone call). Therefore, Apple believes that your application should be supported in the background until the user removes the application from the background. And after that, if you want to exit(0); using exit(0); , the use of this will also lead to the abandonment of the AppStore

+2
source

Here's the wrong way to exit in your application. It comes to mind when I read your question, never apply anywhere, so be careful if you do this!

 - (void) exitApp { NSArray *array = [[[NSArray alloc] init] autorelease]; NSLog(@"%@",[array objectAtIndex:10]); //will crash here, looks like exit. } 

PS You can put this code in your UIAlertView exit confirmation request, for example Do you really want to exit? . With the YES button pressed, you can call [self exitApp]; The user will think that he will exit the application.

-3
source

All Articles