Created
April 22, 2014 13:39
-
-
Save xdream86/11179635 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSError *error = nil; | |
if ([self.managedObjectContext save:&error] == NO) { | |
NSAssert(NO, @"Save should not fail"); | |
[self showAlert]; | |
} | |
- (void)showAlert { | |
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Could Not Save Data" | |
message:@"There was a problem saving your data but it is not your fault. If you restart the app, you can try again. Please contact support (support@domain.com) to notify us of this issue." | |
delegate:self | |
cancelButtonTitle:@"Ok" | |
otherButtonTitles:nil]; | |
[alertView show]; | |
} | |
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { | |
abort(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment