How to sort smoothly when NSTableColumn's Sort Key is empty

2008-06-03 Thread an0
I know how to sort items in NSTableView when each NSTableColumn
corresponds to a property of the item object.
But what if there is only one NSTableColumn and it is just mapped to
the item object itself instead of a property of it?
I set the Selector to compare: and leave the Sort Key to empty for
the NSTableColumn in Interface Builder. It seems items can be sorted
once in such a case but the order can not be reverted by clicking the
column header again.
And the NSTableView's sortDescriptors are found cumulated instead of
changed by NSLog in dataSource's tableView:sortDescriptorsDidChange:
method.
What is the right configuration for such a case then?
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: How to sort smoothly when NSTableColumn's Sort Key is empty

2008-06-03 Thread Hamish Allan
On Tue, Jun 3, 2008 at 4:52 PM, an0 [EMAIL PROTECTED] wrote:

 And the NSTableView's sortDescriptors are found cumulated instead of
 changed by NSLog in dataSource's tableView:sortDescriptorsDidChange:
 method.

Hmm, could be a bug. Try giving your object a readonly property that
returns self, e.g.:

- (id)identity { return self; }

And bind to 'identity' rather than leaving the sort key empty. Let us
know what happens!

Hamish
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]