• 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: NSTreeController, Core Data and root objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTreeController, Core Data and root objects


  • Subject: Re: NSTreeController, Core Data and root objects
  • From: Rob Keniger <email@hidden>
  • Date: Fri, 6 Nov 2009 10:40:34 +1000

On 06/11/2009, at 5:38 AM, Fritz Anderson wrote:

> Here is what I did, for a small tree: My document keeps the root object as a KVO property -- I do not rely on a fetch.
>
> I declare classes for my tree-element entities. so I could implement a method, -(NSArray *)orderedChildren, to return the "children" set, sorted as needed.
>
> I exposed the document (and thus, indirectly, the root) through an NSObjectController.
>
> I bound the tree controller's content _array_ to that root object's orderedChildren key. (Document NSObjectController -> root.orderedChildren). Members of the content array appear as top-level nodes in the outline.
>
> My tree has constant structure, so I can't make any comment on mutation.


Hi Fritz,

Thanks for this pointer. Unfortunately, while this works great for a static tree, it fails when you try to mutate the tree objects. :-/

--
Rob Keniger



_______________________________________________

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: 
 >NSTreeController, Core Data and root objects (From: Rob Keniger <email@hidden>)
 >Re: NSTreeController, Core Data and root objects (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: NSCoder and CGColorRef
  • Next by Date: Re: NSTreeController, Core Data and root objects
  • Previous by thread: Re: NSTreeController, Core Data and root objects
  • Next by thread: Re: NSTreeController, Core Data and root objects
  • Index(es):
    • Date
    • Thread