Reputation: 2281
Please, someone, give me solution how to solve this problem?
I don't know why
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
method is getting called on app crash (crash is created by myself to observe this problem, and I can fix this crash).
I tested it by showing UILocalNotification
and NSUserDefaults
.
The problem is actually observed on iPhone 6 with iOS 9.3.2
,
But with iPhone 5C with iOS 10.0.2
everything is OK (application:didFinishLaunchingWithOptions:
method is not getting called on app crash).
The project is written in Objective C
.
To observe this problem there should be the real crash, not taking an app into background/inactive
state and swiping it up by the user.
Upvotes: 1
Views: 749
Reputation: 401
Add below line in application:didFinishLaunchingWithOptions: method.
NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);
Then, add below code in your appDelegate to get cause of exception:
void uncaughtExceptionHandler(NSException *exception) {
NSLog(@"Exception : %@", exception);
NSLog(@"Stack Trace: %@", [exception callStackSymbols]);
// Internal error reporting
}
Upvotes: 2
Reputation: 136
Click on Project target, Change Deployment Target to 9.3
Upvotes: 0