• 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: CoreData: Can't modify an immutable model
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData: Can't modify an immutable model


  • Subject: Re: CoreData: Can't modify an immutable model
  • From: "Sean McBride" <email@hidden>
  • Date: Tue, 5 Feb 2008 17:04:53 -0500
  • Organization: Rogue Research

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@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada

_______________________________________________

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

  • Follow-Ups:
    • Re: CoreData: Can't modify an immutable model
      • From: Ben Trumbull <email@hidden>
References: 
 >Re: CoreData: Can't modify an immutable model (From: Ben Trumbull <email@hidden>)

  • Prev by Date: Re: CoreData: Can't modify an immutable model
  • Next by Date: Re: stringWithContentsOfURL returns nil
  • Previous by thread: Re: CoreData: Can't modify an immutable model
  • Next by thread: Re: CoreData: Can't modify an immutable model
  • Index(es):
    • Date
    • Thread