Skip navigation.
 
mlRe: CoreData: Can't modify an immutable model
FROM : Sean McBride
DATE : Tue Feb 05 23:04:53 2008

On 2/5/08 1:50 PM, Ben Trumbull said:

>>No, or maybe only for a few microseconds.  I was kind of confused by
>>this the first time that I used Core Data...
>>    First, you "insert".
>>    Then, you modify.
>>Seems backwards, but it works.  You don't "create" a managed object.

>
>Yes.  If you really want to, you can pass nil in for the
>NSManagedObjectContext* parameter, and call -insertObject: later.
>But there's a limit to how much you can do with a managed object if
>it is not registered with a context.  For example, inverse
>relationship maintenance won't work so you can't set any
>relationships.


Ben,

Are you talking about insertNewObject
ForEntityForName:inManagedObjectContext: ?  Do I understand correctly
that the moc parameter is in fact optional?  The docs don't say so, but
I have always wished it was the case.  Can you confirm?  (I'd like to be
able to set some attributes before NSObjectControllers go changing the UI).

Thanks,

--
____________________________________________________________
Sean McBride, B. Eng                <email_removed>
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada

Related mailsAuthorDate
mlRe: CoreData: Can't modify an immutable model Ben Trumbull Feb 5, 22:50
mlRe: CoreData: Can't modify an immutable model Sean McBride Feb 5, 23:04
mlRe: CoreData: Can't modify an immutable model Ben Trumbull Feb 5, 23:18