• 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: Tue, 28 Feb 2006 23:43:29 +0000

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


Thanks
Alexander Hartner
email@hidden

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:
    • Sorting using NSOutlineView, NSTreeController and NSArray / NSMutableArray
      • From: Alexander Hartner <email@hidden>
  • Prev by Date: Tracking Rectangles for feedback on graphic elements
  • Next by Date: Re: NSCalendar bug with adding to pre-1919 dates?
  • Previous by thread: Tracking Rectangles for feedback on graphic elements
  • Next by thread: Sorting using NSOutlineView, NSTreeController and NSArray / NSMutableArray
  • Index(es):
    • Date
    • Thread