In my application I have two managed object contexts, as I need to be able to 
save two subsets of my Core Data setup separately. 
These are both using one and the same persistent store coordinator; the 
coordinator has two stores. 
 
I take care that every object instance gets inserted into the right 
managedObjectContext, by using [NSEntityDescription 
insertNewObjectForEntityForName: ...]. And it gets assigned to the right 
persistent store by using
 
- (void) awakeFromInsert
{
   ...
   [managedObjectContext assignObject:self toPersistentStore: 
[persistentStoreCoordinator persistentStoreForURL: url]];
}.
There are no relationships between objects in different persistent stores, as 
it should be.
 
This seems to work OK on one system, but leads to a strange error on two other 
systems (for the same program).
 
When a change has been made to the Core Data objects (e.g. adding an instance), 
the 'save' action of the managedObjectContext gives an exception (no error 
screen) saying 'can't reassign object to a different store once it has been 
saved'. 
This means the Core Data stack cannot be saved anymore, which is of course a 
serious problem. 
 
Do you know what causes this error? Do I need to use a different setup for the 
managedObjectContext - persistentStoreCoordinator - persistentStores system?
 
 
Thanks for your time,
Arthur C.
 
 
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to