Sorting using NSOutlineView, NSTreeController and NSArray / NSMutableArray
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