• 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: Core data entity creation design
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core data entity creation design


  • Subject: Re: Core data entity creation design
  • From: Dave Fernandes <email@hidden>
  • Date: Sun, 24 Aug 2008 12:34:01 -0400
  • Resent-date: Sun, 24 Aug 2008 12:34:32 -0400
  • Resent-from: Dave Fernandes <email@hidden>
  • Resent-message-id: <email@hidden>
  • Resent-to: "cocoa (Apple)" <email@hidden>

If the second entity is instantiated whenever the first is, then you can just add code to create the second entity (NSEntityDescription insertNewObjectForEntityForName:inManagedObjectContext:) inside the awakeFromInsert method of the first object. Thus, you only have to explicitly create the first entity.

Dave

On Aug 24, 2008, at 6:17 AM, Steven Hamilton wrote:

Hi folks,
I have a Core Data model which contains two entities. I have a tableview with the standard bindings arrangement and Add/Remove buttons handling one of the entities. What I need to achieve is that when the Add button is pressed both entity types are created, not just the one thats displayed in the table. I notice I can't use the button to send two Add: actions so I can't do one automatically, and the other in a custom class.


What's the best way to handle this situation? My first thought is ditching the bindings and implementing the table datasource methods. My next was perhaps subclassing the array controller.


_______________________________________________

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:
40utoronto.ca


This email sent to email@hidden

_______________________________________________

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


  • Prev by Date: Re: Nil Object Crashing KVO
  • Next by Date: Semi-transparent, blurred NSWindow background?
  • Previous by thread: Re: Core data entity creation design
  • Next by thread: Streching subviews to fit in a SpilitView
  • Index(es):
    • Date
    • Thread