• 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
Sorting using NSOutlineView, NSTreeController and NSArray / NSMutableArray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sorting using NSOutlineView, NSTreeController and NSArray / NSMutableArray


  • Subject: Sorting using NSOutlineView, NSTreeController and NSArray / NSMutableArray
  • From: Alexander Hartner <email@hidden>
  • Date: Thu, 2 Mar 2006 00:05:38 +0000

I am wondering if anybody could point me to a simple example which implements bindings on an NSOutlineView.

Thanks
Alex

I have an NSOutlineView with 2 columns. Each NSTableColumn has it's value attribute bound to the NSTreeController. The NSTreeController is bound to an NSArray. In the documentation it is suggested the the sort descriptor of the NSTreeController is typically bound to the SortDescriptor of NSArrayController of the initially bound NSTableColumn.

My NSTableColumn has it's value attribute bound to the arrangedObjects of the NSTreeController rather then an NSArrayController. Could somebody please clearify how I can achieve to sort the first column of the NSOutlineView.

Up to now I tried to avoid writing a SortDescriptor, but if this is the best option I will do so. I this case I would just like to confirm that writing a sort descriptor and binding it "manually" to the NSTreeController would solve the problem.


Extract from : http://developer.apple.com/documentation/Cocoa/ Reference/CocoaBindingsRef/BindingsText/NSTreeController.html
...
NSTreeController Bindings
...
sortDescriptors
An indexed collection of NSSortDescriptor instances that specify the sort ordering of the contents of the NSTreeController.
The indexed collection is an NSArray instance or subclass, or a property that is accessible using the key-value-coding indexed accessor methods.
Typically this binding is created automatically, binding to the sort descriptors of the NSArrayController of the initially bound NSTableColumn.
Availability:
Available in Mac OS X v10.4 and later.
...

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Sorting using NSOutlineView, NSTreeController and NSArray / NSMutableArray
      • From: Alexander Hartner <email@hidden>
References: 
 >Sorting using NSOutlineView, NSTreeController and NSArray / NSMutableArray (From: Alexander Hartner <email@hidden>)

  • Prev by Date: Re: Removing NSLinkAttributeName doesn't remove the other attributes
  • Next by Date: NSBitmapImageRep getPixel and color Spaces
  • Previous by thread: Sorting using NSOutlineView, NSTreeController and NSArray / NSMutableArray
  • Next by thread: Re: Sorting using NSOutlineView, NSTreeController and NSArray / NSMutableArray
  • Index(es):
    • Date
    • Thread