Re: trouble keeping NSTableView sorted
Re: trouble keeping NSTableView sorted
- Subject: Re: trouble keeping NSTableView sorted
- From: Keary Suska <email@hidden>
- Date: Fri, 07 Dec 2007 12:40:03 -0700
- Thread-topic: trouble keeping NSTableView sorted
on 12/7/07 7:48 AM, email@hidden purportedly said:
> Hello,
>
> To keep a NSTableView contents sorted I believe I need to bind the
> table's sortDescriptors to the array controller the table is bound
> to.
Depends on what you mean by "keeping sorted", although your approach is
incorrect for just about any interpretation.
If you mean that you want a set sort order that the user can't change, then
bind the tablevew's selectionIndexes to the array controller. This will
disable column header sorting.
Sort descriptors are implicitly bound, so you don't have to be concerned
about them. Just make sure the array controller has the correct sort
descriptors already set.
> Bind to: MyController
> Controller Key: arrangedObjects
> Model Key Path: name
>
> "name" is the key to the NSString value of the objects MyController
> handles.
If the above isn't simply a random stab in the dark, you really need to
re-read the bindings documentation and examples, as well as the docs on
NSSortDescriptor. The above seems to show that you aren't clear on either.
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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