• 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 with NSArrayController Confusion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data with NSArrayController Confusion


  • Subject: Re: Core Data with NSArrayController Confusion
  • From: "I. Savant" <email@hidden>
  • Date: Tue, 8 Apr 2008 13:20:53 -0400

>  Adding a cell, in addition to creating a new Cell entity, also has to do
> some custom tasks on initialization.  Each cell has a one-to-one
> relationship with another managed object (Scene), so the scene object needs
> to be created and inserted in to the MOM when the cell is created.

  This is 'business logic' that belongs in your model. Subclass
NSManagedObject for your Cell entity (remember to set the entity to
use the custom subclass in your data model) and put the
"create-my-dependent-object(s)-and-establish-relationships" logic
inside the -awakeFromInsert method.

> Also, the starting location of the cell in the CellMapView is determined by
> fetching all existing cells in the context and figuring out the first spot
> that is not occupied by a previously created cell.

  Same as above; determine this in -awakeFromInsert and configure as necessary.

>  What gives?  Is overriding "newObject" not the way to go in my situation?

  For this? Emphatically: NO.

--
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

  • Follow-Ups:
    • Re: Core Data with NSArrayController Confusion
      • From: Michael Burns <email@hidden>
References: 
 >Core Data with NSArrayController Confusion (From: Michael Burns <email@hidden>)

  • Prev by Date: Re: Core Animation layer-backed NSViews and mouse handling
  • Next by Date: Re: Getting the mouse location in a CAlayer's coordinates
  • Previous by thread: Core Data with NSArrayController Confusion
  • Next by thread: Re: Core Data with NSArrayController Confusion
  • Index(es):
    • Date
    • Thread