CoreData + iCloud + Cascade Delete - how to handle? CoreData + iCloud + Cascade Delete - how to handle? ios ios

CoreData + iCloud + Cascade Delete - how to handle?


From experience, listening to notifications other than NSManagedObjectContextDidSaveNotification is a big mess and can lead to relying on properties not yet updated. The detail view controller should listen to NSManagedObjectContextDidSaveNotification notifications, which are thrown after cascade is applied. You can then check by several means if the current object is valid or not (you can check to see if the current object's managed object context is nil or you can perform a fetch and see if the object exists in the store).