I have an app that uses [NSUserDefaults standardUserDefaults] to store session information. Generally, this information is checked on app launch, and updated on app exit. I
I have the same problem with iOS 8 and the only solution worked for me is to delay perform of exit() function some duration (Ex.: 0.1 seconds) using:
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC / 10), dispatch_get_main_queue(), ^{ exit(0); });
or create a method and then call it using performSelector:withObject:afterDelay:
- (void)exitApp {
exit(0);
}
[self performSelector:@selector(exitApp) withObject:nil afterDelay:0.1];