Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSManagedObjectContextObjectsDidChangeNotification not always called instantly

I have an Mac Application using a NSPersistentDocument. I want to get notified when Objects are deleted to save this information using Core Data. So I'm listening for NSManagedObjectContextObjectsDidChangeNotification. Often it is called instantly when objects are deleted, but sometimes it is only called after the persistent document is saved with all deleted objects not being notified before. Because I want to let the user directly export all existing objects (and not the deleted anymore) what to I have to do to become notified instantly to save the delete information or do I have to use it in another way?

like image 328
Tobe Avatar asked Oct 12 '11 15:10

Tobe


1 Answers

NSManagedObjectContextObjectsDidChangeNotification is no longer issued as frequently or quickly on 10.7 as on 10.6. You can force Core Data to issue the notification (assuming there are changes) by calling -[NSManagedObjectContext processPendingChanges].

like image 149
Aderstedt Avatar answered Sep 19 '22 17:09

Aderstedt