• 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: NSEntityDescription to NSManagedObject
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSEntityDescription to NSManagedObject


  • Subject: Re: NSEntityDescription to NSManagedObject
  • From: SA Dev <email@hidden>
  • Date: Tue, 28 Jun 2005 09:43:15 -0400

Jeff:

From the docs: "Creates and returns a new autoreleased instance of class for the entity with the specified name, sets its entity description, inserts it into the specified managed object context."

This *is* the way to get the instance of the entity you just created. The object that's passed back to you is an instance of your entity. Since any objects you use in your data model must be NSManagedObject or a subclass thereof, the object you get back from insertNewObjectForEntityForName:inManagedObjectContext: is as well.

To my knowledge, this method does *not* pass back an NSEntityDescription, though you could ask the resulting NSManagedObject instance for its -entity (which will give you an NSEntityDescription).




On Jun 28, 2005, at 9:33 AM, Jeff LaMarche wrote:

When you call NSEntityDescription's insertNewObjectForEntityName:inManagedContext:, you get (of course) an NSEntityDescription. You can set and get values using this, so usually that's cool. But is there a shortcut to getting the same object as an NSManagedObject, or do you have to create a predicate and do a fetch request?

Thanks,
Jeff
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40silentalcove.net


This email sent to email@hidden


_______________________________________________ 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
References: 
 >NSEntityDescription to NSManagedObject (From: Jeff LaMarche <email@hidden>)

  • Prev by Date: NSEntityDescription to NSManagedObject
  • Next by Date: Thwarting classdump, etc.
  • Previous by thread: NSEntityDescription to NSManagedObject
  • Next by thread: Thwarting classdump, etc.
  • Index(es):
    • Date
    • Thread