Nested NSManagedObjectContext save and objectID

Viewed 365

childContext and parentContext are both of "NSMainQueueConcurrencyType"

[childContext performBlock:^(void) {
  [childContext save:NULL];

  [parentContext performBlock:^(void) {
    [parentContext save:NULL];
    // Why is objectID for the inserted NSManagedObject still a temporary one here?
  }];
}];

Question:

  1. Is this the right way to save both the child and parent context
  2. Why is it that after saving, the inserted NSManagedObject's objectID is still a temporary one?
1 Answers
Related