• 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: managedObjectIDForURIRepresentation returning wrong NSManagedObjectID
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: managedObjectIDForURIRepresentation returning wrong NSManagedObjectID


  • Subject: Re: managedObjectIDForURIRepresentation returning wrong NSManagedObjectID
  • From: Mike Abdullah <email@hidden>
  • Date: Fri, 08 Feb 2013 11:49:25 +0000

On 8 Feb 2013, at 09:06, Ben <email@hidden> wrote:

> I'm confused by the following code. What I'm trying to do is store a reference in a DogManagedObject transformable property, to a CatManagedObject, then retrieve the Cat from the Dog at a later date.
> However, when I log the output I get a class of 'Dog' rather than 'Cat'.

Make sure you're aware of the consequences of this. Managed objects only have a *temporary* ID until they are first saved. Only once assigned a permanent ID can you reasonably rely on looking up the object in future.

That said, why not use a relationship here?


_______________________________________________

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

References: 
 >managedObjectIDForURIRepresentation returning wrong NSManagedObjectID (From: Ben <email@hidden>)

  • Prev by Date: Timeline control like in ScreenFlow...how i can implement?
  • Next by Date: Re: Help me fix a bug: endless recursion in NSTextView?
  • Previous by thread: Re: managedObjectIDForURIRepresentation returning wrong NSManagedObjectID
  • Next by thread: Icons in the menubar
  • Index(es):
    • Date
    • Thread