• 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: Setting Core Data attribute values to related entity attribute values
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting Core Data attribute values to related entity attribute values


  • Subject: Re: Setting Core Data attribute values to related entity attribute values
  • From: "Hamish Allan" <email@hidden>
  • Date: Wed, 16 Jul 2008 17:51:57 +0100

On Wed, Jul 16, 2008 at 5:12 PM, Jamie Phelps
<email@hidden> wrote:

> I have a Core Data entity in a Master-Detail view. In the detail view, I
> have a button that is bound to the createFoo: method of the selected object
> where Foo is the class name of the related entity. What I want to do is use
> this button to create a Foo and set its relationship programmatically.

That sort of code belongs in a controller -- the model knows nothing
about the selection.

>  In my awakeFromInsert: method for the Foo class, I want to set attribute
> values based on the related entity. If it's null, I have some defaults, but
> if the relationship is present, I want to set some values equal to the
> corresponding attribute in the related entity as defaults.

Do you really have to duplicate the information? It'll make your life
harder if any of it changes...

Hamish
_______________________________________________

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

References: 
 >Setting Core Data attribute values to related entity attribute values (From: Jamie Phelps <email@hidden>)

  • Prev by Date: Re: KVO notifications and threads
  • Next by Date: Re: Handling key equivalents in a controller class?
  • Previous by thread: Setting Core Data attribute values to related entity attribute values
  • Next by thread: NSButton alternate image problem - not redrawing
  • Index(es):
    • Date
    • Thread