NSManagedObject's hasChanges is true while changedValues is empty

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

I am trying to observe individual NSManagedObject changes on NSManagedObjectContextWillSaveNotification:

- (void)managedObjectContextWi         


        
5条回答
  •  情书的邮戳
    2021-02-12 23:33

    I encountered the same issue. Instead of getting the flags, I just checked if changedValues() is empty.

    For Swift:

    if !managedObject.changedValues().isEmpty {
        // Has some changed values
    }
    

提交回复
热议问题