re:Persistent store removal throwing invalidated NSManagedObject exceptions
re:Persistent store removal throwing invalidated NSManagedObject exceptions
- Subject: re:Persistent store removal throwing invalidated NSManagedObject exceptions
- From: Ben Trumbull <email@hidden>
- Date: Wed, 1 Apr 2009 13:07:39 -0700
I've setup a temporary managed object context to export data to an
external XML file (persistent store). When I remove the persistent
store from the context, I am getting errors like this:
Exception raised during posting of notification. Ignored. exception:
'The NSManagedObject with ID:0x18656990 <x-coredata://2E9A390F-BA42-48E7-847A-EAB4E11CCCF1/CollectionGroup/p104
has been invalidated.' invoked observer method: '*** -
[NSManagedObjectContext _storeConfigurationChanged:]' observer:
0x1864d370 notification name:
'_NSPersistentStoreCoordinatorStoresDidChangePrivateNotification'
When you remove a store from the coordinator, all the live managed
objects from that store are invalidated. Their backing store is gone,
so they are pretty useless, and we cannot fulfill any requests to
materialize faults without the store.
So what you see here is a KVO observer trying to fire a fault after
you've removed the store and the fault is severed from the backing
persistence mechanism.
You should remove all your KVO observers before removing the store.
- Ben
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden