ios coredata NSManagedObject 的 objectID

时间:2023-03-09 08:56:43
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.