Re: CoreData: Can't modify an immutable model
Re: CoreData: Can't modify an immutable model
- Subject: Re: CoreData: Can't modify an immutable model
- From: "I. Savant" <email@hidden>
- Date: Tue, 5 Feb 2008 10:44:02 -0500
> I am trying to create a core data entity using the method
> enittyForName: inManagedObjectContext . I can create the entity just
> fine but when I try to set one of the attributes I get the following
> error:
>
> Can't modify an immutable model
Do you mean you're trying to define a managed object model in code
(versus using XCode's modeler) or you're trying to create an
*instance* of an entity (a managed object) then set its attributes?
The method+entityForName:inManagedObjectContext: "Returns the entity
with the specified name from the managed object model associated with
the specified managed object context's persistent store coordinator."
This is the entity itself (rather, an NSEntityDescription), not an
instance of it.
See this document:
http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdCreateMOs.html
--
I.S.
_______________________________________________
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