objective c - NSManagedObjectContextObjectsDidChangeNotification NSDeletedObjectsKey Objects no longer has references to related objects -
i want respond changes of nsmanagedobjects have been added, updated, or deleted.
i have issue deleted objects, though: relationships other objects nil.
is there way kind of notification before object affected way?
edit:
this delete code:
[moc deleteobject:myobject]; id saveblock = ^{ nserror *error = nil; bool saved = no; saved = [self save:&error]; // error handling. }; [moc performblockandwait:saveblock];
if wanting react deletions should listening nsmanagedobjectcontextwillsavenotification , watch nsdseletedobjectskey come through part of notification. lastly chance before deletion deal them.
objective-c core-data nsmanagedobject nsmanagedobjectcontext
No comments:
Post a Comment