I want to quit the application if it is not able to download the database from the server. I try to download the database using NSURLSession
. if it doesn't then show the alert view.
when user clicks on ok button in the alert, then i want to quit the application. As there is no database, it will crash to proceed. To avoid the crash i want to quit from the app programatically.
I want to achieve something like android's finish().
I have one util.h and util.m which does all download show alert box job. It extends NSObject. It is just like an utility not a controller.
Util.h
#import <Foundation/Foundation.h>
@interface Util : NSObject {
NSURLSession *session;
//NSDictionary *plistDictionary;
NSURLSessionTask *task1;
NSURLSessionTask *task2;
NSURLSessionTask *task3;
UIAlertView *alertViewSpin;
NSMutableData *receivedData;
}
I have seen in one of the SO post..
[self dismissViewControllerAnimated:YES completion:nil];
[self.navigationController popViewControllerAnimated: YES];
But did not help. How can I do this?