Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. [[MYCoreDataManager sharedInstance]doTaskwithCompletion:^(BOOL complete) {
  2.  
  3. if (complete == YES) {
  4.  
  5. dispatch_async(dispatch_get_main_queue(), ^{
  6.  
  7. // back to the main thread
  8. });
  9. }
  10.  
  11. }];
  12.  
  13. -(void)doTaskwithCompletion:(coreDataCompletion)complete
  14. {
  15. [self.backgroundManagedObjectContext performBlock:^{
  16.  
  17. // do my BG core data task
  18.  
  19. [self saveContext:self.backgroundManagedObjectContext];
  20. complete(YES);
  21.  
  22. }];
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement