• 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: How to remove all objects from a NSTreeController ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to remove all objects from a NSTreeController ?


  • Subject: Re: How to remove all objects from a NSTreeController ?
  • From: Sébastien Stormacq <email@hidden>
  • Date: Fri, 27 Nov 2009 07:26:13 +0100

On 27 Nov 2009, at 07:04, Rob Keniger wrote:
>
> On 26/11/2009, at 11:27 PM, Sébastien Stormacq wrote:
>
>> I am developing an Cocoa application using a NSTreeView, bound to a NSTreeController.
>> The application is build around a master-detail structure, with an NSOutlineView on the left side and a NSTableView on the right side (similar to iTunes)
>>
>> I would like to remove all elements from the detail table when the user changes selection in the Outline View before adding new elements, fair enough :-) ?
>
>
> You don't need to do this. Just create an NSArrayController for your NSTableView that is bound to the "selection" key of the NSTreeController. The NSArrayController will then populate the table view for you.
>


I am binding to arrangedObjects of the NSArrayController

Seb

> If you need to manually manage the objects that are in the table view then you may need to use a datasource for the table view rather than an NSArrayController. Your datasource can use KVO to observe the selection key of the NSTreeController and update the table view as appropriate.
>
> --
> 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

_______________________________________________

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: How to remove all objects from a NSTreeController ?
      • From: Rob Keniger <email@hidden>
References: 
 >How to remove all objects from a NSTreeController ? (From: Sébastien Stormacq <email@hidden>)
 >Re: How to remove all objects from a NSTreeController ? (From: Rob Keniger <email@hidden>)

  • Prev by Date: Re: How to remove all objects from a NSTreeController ?
  • Next by Date: Re: UIImageView Animation Question
  • Previous by thread: Re: How to remove all objects from a NSTreeController ?
  • Next by thread: Re: How to remove all objects from a NSTreeController ?
  • Index(es):
    • Date
    • Thread