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]);
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.
source share