Re: NSEntityDescription to NSManagedObject
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