According to iPhone OS Reference Library Q&A, Q: How do I programmatically quit my iPhone OS application? There is no API provided for gracefully terminating an iPhone application.
Alternatively, we can use exit(0) to force the iPhone application to terminate.
@implementation iPhoneExitViewController
- (IBAction)exitButtonPressed:(id)sender{
exit(0);
}
