ios coredata NSManagedObject 的 objectID

要使用这个属性一定要注意先把数据保存下,不然会变化的!就无法通过

- (NSManagedObject*)existingObjectWithID:(NSManagedObjectID*)objectID error:(NSError**)error NS_AVAILABLE(10_6, 3_0);

方法取得对象了,下面是这个属性的英文介绍:

IMPORTANT

If the receiver has not yet been saved, the object ID is a temporary value that will change when the object is saved.

原文地址:https://www.cnblogs.com/breezemist/p/4686350.html