• 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
CoreData: "Can't reassign an object to a different store once it has been saved."?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CoreData: "Can't reassign an object to a different store once it has been saved."?


  • Subject: CoreData: "Can't reassign an object to a different store once it has been saved."?
  • From: Jim Correia <email@hidden>
  • Date: Fri, 15 Jul 2005 09:19:19 -0400

I have an application which borrows techniques from CoreRecipies.

It uses two stores - an XML store and an in memory store. The in memory store holds the library smart group (as in core data). The on disk store holds the other entities - in this case items and labels. When I create a new item and apply a label to it (sets a to-one relationship on the item) then save, I get

"Can't reassign an object to a different store once it has been saved."

#0 0x94024f04 in -[NSPersistentStoreCoordinator (_NSInternalMethods) _assignObject:toPersistentStore:]
#1 0x9402324c in -[NSPersistentStoreCoordinator (_NSInternalMethods) _assignObjects:toStore:]
#2 0x9402360c in -[NSPersistentStoreCoordinator (_NSInternalMethods) _doPreSaveAssignmentsForRequest:]
#3 0x93fec434 in -[NSPersistentStoreCoordinator (_NSInternalMethods) executeRequest:withContext:]
#4 0x93fff6a8 in -[NSManagedObjectContext save:]


Interestingly enough, the store it is trying to assign to the object to appears to be the store the object already lives in.

(gdb) po [[$r5 objectID] persistentStore]
<NSXMLObjectStore: 0x368380>
(gdb) po $r6
<NSXMLObjectStore: 0x368380>

Any idea what I've done wrong, and how to correct it?

Thanks,
Jim


_______________________________________________ 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: "Can't reassign an object to a different store once it has been saved."?
      • From: Jim Correia <email@hidden>
  • Prev by Date: Re: NSMutableArray is immutable when unarchived
  • Next by Date: Re: Draw a portion of NSTextView
  • Previous by thread: Re: Draw a portion of NSTextView
  • Next by thread: Re: CoreData: "Can't reassign an object to a different store once it has been saved."?
  • Index(es):
    • Date
    • Thread