Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. dispatch_async(dispatch_get_main_queue(), ^{
  2. NSManagedObjectContext *childContext = [[[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType] autorelease];
  3. childContext.parentContext = self.managedObjectContext;
  4. [childContext performBlock:^{
  5. // do something with childContext and save
  6. }];
  7. });
  8.  
  9. dispatch_async(dispatch_get_main_queue(), ^{
  10. NSManagedObjectContext *childContext = [[[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType] autorelease];
  11. childContext.parentContext = self.managedObjectContext;
  12. [childContext performBlock:^{
  13. [RequestOperationManager POST... parameters... success...{
  14. // Can I re-use childContext here?
  15. }];
  16. }];
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement