• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [COREDATA] Assign NSManagedObject to persistent store
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: [COREDATA] Assign NSManagedObject to persistent store
      • From: Guillaume Rager <email@hidden>
References: 
 >[COREDATA] Assign NSManagedObject to persistent store (From: Guillaume Rager <email@hidden>)

  • Prev by Date: Re: Getting data from NSOutlineView
  • Next by Date: CoreData: "Can't reassign an object to a different store once it has been saved."?
  • Previous by thread: [COREDATA] Assign NSManagedObject to persistent store
  • Next by thread: Re: [COREDATA] Assign NSManagedObject to persistent store
  • Index(es):
    • Date
    • Thread