Re: [COREDATA] Assign NSManagedObject to persistent store
Re: [COREDATA] Assign NSManagedObject to persistent store
- Subject: Re: [COREDATA] Assign NSManagedObject to persistent store
- From: Bill Bumgarner <email@hidden>
- Date: Tue, 13 Dec 2005 08:37:12 -0800
On Dec 13, 2005, at 6:50 AM, Guillaume Rager wrote:
I have one managedObjectContext and two persistent stores (sqlstore
and inMemoryStore) linked to this context.
Each time I create a managed object, it is assigned to the sqlstore
or to the inMemoryStore. But sometimes I would like to finally put
an object from inMemoryStore to sqlStore, but "coredata" does not
seem to be ok, because context has been already saved.
So, do you have any solution to move a given object into another
store ?
Once an object is saved into a store, that instance of that managed
object will always live in that store. There is no notion of moving
an object from one store to another.
At first glance, this may seem like an oversight on the part of the
Core Data implementation. The problem is actually considerably more
difficult. Core Data is all about managing a complex object graph;
managing a set of objects that have relationships between each other.
If you were to move one object, what does that imply for the rest of
the object graph? Without cross store relationships (which are
really hard in generic terms), it would imply that the object and
everything it is connected to would also have to move from one store
to the other.
Out of curiosity, why do you have the two stores in the first place?
b.bum
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden