title: Core Data: Do child contexts ever get permanent objectIDs for newly inserted objects?
body: <p>I have an app with two managed object contexts setup like this:</p>
  
  <ul>
  <li>Parent Context: NSPrivateQueueConcurrencyType, linked to the persistent store.</li>
  <li>Main Context: NSMainQueueConcurrencyType, child of Parent Context.</li>
  </ul>
  
  <p>When insert a new managed object to the main context, I save the main context and then the parent context like this:</p>
  
  <pre><code>[context performBlockAndWait:^{
      NSError * error = nil;
      if (![context save: &amp;error]) {
          NSLog(@"Core Data save error %@, %@", error, [error userInfo]);
      }
  }];
  
  [parentContext performBlock:^{
      NSError *error = nil;
      BOOL result = [parentContext save: &amp;error];
      if ( ! result ) {
          NSLog( @"Core Data save error in parent context %@, %@", error, [error userInfo] );
      }
  }];
  </code></pre>
  
  <p>My understanding is that when the manage object is first created, it has a temporary <code>objectID</code>. Then the main context is saved and this object, with its temporary ID, gets to the parent context. Then the parent context is saved. When this last context is saved, the temporary <code>objectID</code> in the parent context gets transformed into a permanent <code>objectID</code>. </p>
  
  <p>So:</p>
  
  <p><ul>
  <li>Does the permanent object ID ever get propagated automatically back
  to the main (child) context?</li>
  <li>When I force to get the object permanent ID with
  <code>[NSManagedObjectContext obtainPermanentIDsForObjects:error:]</code>, then background the app, reactivate it, reload, get the object using main context's <code>objectWithID:</code>, and access a property, I get </p>
  
  <blockquote>
    <p>"CoreData could not fulfill a fault for ...". </li>
    </ul>
    What is wrong with this approach?</p>
  </blockquote>