I want to make sure that an NSManagedObject that I am working with has a permanent NSManagedObjectID. I know that it only is made permanent on [NSManagedObjectContext save:] or [NSManagedObjectContext obtainPermanentIDsForObjects:error:]. However, before I save the context to get a permanent ID, is there a way to determine if an object has a permanent ID or not? That way I don’t needlessly save the store.
Share
NSManagedObjectIDhas aisTemporaryIDmethod that indicates whether the object ID is temporary, so you can checkHowever, I would just call
obtainPermanentIDsForObjectsfor the objects in question because I assume that this does not cause additional overhead if the object IDs are already permanent.