NSManagedObject's hasChanges is true while changedValues is empty

后端 未结 5 835
心在旅途
心在旅途 2021-02-12 22:41

I am trying to observe individual NSManagedObject changes on NSManagedObjectContextWillSaveNotification:

- (void)managedObjectContextWi         


        
5条回答
  •  不知归路
    2021-02-12 23:34

    According to doc, hasChanges will return YES if the receiver has been inserted, has been deleted, or has unsaved changes, otherwise NO.

    In your case, you can check isInserted, isUpdated, isDeleted flag to find what happened to your managed object. changedValues only show the properties that have been changed since last fetching or saving the receiver.

提交回复
热议问题