Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (void) contextDidSaveFromSeparateThread:(NSNotification*)notification {
  2.     [[self managedObjectContext] mergeChangesFromContextDidSaveNotification:notification];
  3.    
  4.     [self saveContext];
  5. }
  6.  
  7. - (void) saveContext {
  8.     NSError *error = nil;
  9.     NSManagedObjectContext *context = [self managedObjectContext];
  10.     [context save:&error];
  11.    
  12.     if (error != nil) {
  13.        NSAssert1(0, @"Error saving current context -> %@", error);
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement