Re: Sorting an NSTableView bound to an NSArrayController.

2012-06-29 Thread Robert Tillyard
Thank you, Willeke, That worked brilliantly. Regards, Rob. On 29 Jun 2012, at 22:15, Willeke wrote: > > Op 28 jun 2012, om 17:44 heeft Robert Tillyard het volgende geschreven: > >> >> I now I need to put a key and sort descriptor in IB but don't know what code >> I have to add to the Entity

Re: Sorting an NSTableView bound to an NSArrayController.

2012-06-29 Thread Willeke
Op 28 jun 2012, om 17:44 heeft Robert Tillyard het volgende geschreven: > > I now I need to put a key and sort descriptor in IB but don't know what code > I have to add to the Entity ot WindowController to handle it. You can create a category of NSString and implement your own compare method.

Re: Sorting an NSTableView bound to an NSArrayController.

2012-06-28 Thread Keary Suska
On Jun 28, 2012, at 1:16 PM, Robert Tillyard wrote: > Hello, Keary, > > Thank you for your reply. > > Would the selector in the model be in the class for the CoreData Entity or os > it in the WindowController sub-class that controls the window that the > TableView is in? > > Would you know w

Sorting an NSTableView bound to an NSArrayController.

2012-06-28 Thread Robert Tillyard
Hello, I'm writing an application that handles results for a running club. I have an NSTableView that has columns bound to a CoreData Entity such as Entries.arrangedObjects.position, position is an NSString that contains numbers such as @"1" and @"2" or @"" but the position can also be @"DNF" (

Re: programmatically sorting an NSTableView

2011-07-13 Thread Peter
See here: http://www.cocoabuilder.com/archive/cocoa/174051-programmatically-sort-nstableview.html and here http://www.cocoabuilder.com/archive/cocoa/115880-programatically-sorting-tableview.html Am 12.07.2011 um 22:43 schrieb James Walker: > I have an NSTableView containing one column, which i

Re: programmatically sorting an NSTableView

2011-07-13 Thread James Walker
On 7/12/2011 11:43 PM, Ken Thomases wrote: On Jul 12, 2011, at 9:24 PM, James Walker wrote: On 7/12/2011 6:14 PM, Ken Thomases wrote: On Jul 12, 2011, at 5:36 PM, James Walker wrote: On 7/12/2011 2:04 PM, Ken Thomases wrote: Invoking -setSortDescriptors: on the array controller does sort i

Re: programmatically sorting an NSTableView

2011-07-12 Thread Ken Thomases
On Jul 12, 2011, at 9:24 PM, James Walker wrote: > On 7/12/2011 6:14 PM, Ken Thomases wrote: >> On Jul 12, 2011, at 5:36 PM, James Walker wrote: >> >>> On 7/12/2011 2:04 PM, Ken Thomases wrote: >>> Invoking -setSortDescriptors: on the array controller does sort it (or should). Ba

Re: programmatically sorting an NSTableView

2011-07-12 Thread James Walker
On 7/12/2011 6:14 PM, Ken Thomases wrote: On Jul 12, 2011, at 5:36 PM, James Walker wrote: On 7/12/2011 2:04 PM, Ken Thomases wrote: Invoking -setSortDescriptors: on the array controller does sort it (or should). Back on 10.4, it may have been necessary to follow that with a call to -rearran

Re: programmatically sorting an NSTableView

2011-07-12 Thread Ken Thomases
On Jul 12, 2011, at 5:36 PM, James Walker wrote: > On 7/12/2011 2:04 PM, Ken Thomases wrote: > >> Invoking -setSortDescriptors: on the array controller does sort it (or >> should). >> Back on 10.4, it may have been necessary to follow that with a call to >> -rearrangeObjects. > > -[NSArrayCont

Re: programmatically sorting an NSTableView

2011-07-12 Thread James Walker
> Am 12.07.2011 um 22:43 schrieb James Walker: > >> I have an NSTableView containing one column, which is bound to an >> NSArrayController. I've set a sort key and selector for the column >> in IB, and I've called setSortDescriptors: on the array controller. >> Clicking the column header sorts it

Re: programmatically sorting an NSTableView

2011-07-12 Thread Ken Thomases
On Jul 12, 2011, at 3:43 PM, James Walker wrote: > I have an NSTableView containing one column, which is bound to an > NSArrayController. I've set a sort key and selector for the column in IB, > and I've called setSortDescriptors: on the array controller. Clicking the > column header sorts it,

programmatically sorting an NSTableView

2011-07-12 Thread James Walker
I have an NSTableView containing one column, which is bound to an NSArrayController. I've set a sort key and selector for the column in IB, and I've called setSortDescriptors: on the array controller. Clicking the column header sorts it, but how can I sort programmatically? It seems odd that

Re: Sorting an NSTableView

2008-11-30 Thread Gerriet M. Denkmann
On 30 Nov 2008, at 14:05, Patrick Mau wrote: Hello Gerriet If you select the table column and look at the inspector window, you'll find a "Sort key" and "Selector" input field. These are used to create the NSSortDescriptor. Regards Patrick (Small screenshot attached, sorry if it's again

Sorting an NSTableView

2008-11-29 Thread Gerriet M. Denkmann
I have an NSTableView, filled by an NSArrayController. A column has "Creates Sort Descriptor" selected in InterfaceBuilder. And right: when I click on this column, an NSSortDescriptor gets created with the selector "compare:". Works fine; only "compare:" is quite unusable; the documentation q

Re: Issue sorting an NSTableView

2008-07-24 Thread Seth Willits
On Jul 24, 2008, at 8:48 AM, Timothy Reaves wrote: The documentation for NSTableView setSortDescriptors: starts off with "A table column is considered sortable if it has a sort descriptor that specifies the sorting ". I find this a bit puzzling as this is the documentation for NSTableView

Re: Issue sorting an NSTableView

2008-07-24 Thread Corbin Dunn
On Jul 24, 2008, at 8:48 AM, Timothy Reaves wrote: The documentation for NSTableView setSortDescriptors: starts off with "A table column is considered sortable if it has a sort descriptor that specifies the sorting ". I find this a bit puzzling as this is the documentation for NSTableVie

Issue sorting an NSTableView

2008-07-24 Thread Timothy Reaves
The documentation for NSTableView setSortDescriptors: starts off with "A table column is considered sortable if it has a sort descriptor that specifies the sorting ". I find this a bit puzzling as this is the documentation for NSTableView, not NSTableColumn. What is the correct formulat

Re: sorting an NSTableView

2008-06-01 Thread Vijay Malhan
On Sun, Jun 1, 2008 at 5:53 AM, James W. Walker <[EMAIL PROTECTED]> wrote: > > On May 30, 2008, at 5:04 AM, Vijay Malhan wrote: > > An Example: >> mTable = member instance for your TableView >> mData = member array which provides the data-objects. >> >> Put the following code at a place where you

Re: sorting an NSTableView

2008-05-31 Thread James W. Walker
On May 30, 2008, at 5:04 AM, Vijay Malhan wrote: An Example: mTable = member instance for your TableView mData = member array which provides the data-objects. Put the following code at a place where your table and data-source array is initialized. Like in awakeFromNib: method. Here I'm sor

Re: sorting an NSTableView

2008-05-30 Thread Ken Worley
On May 30, 2008, at 12:48 AM, James W. Walker wrote: Hi. I'm a Cocoa newbie, and I'm trying to figure out how to enable sorting columns of my table, but the NSTableView guide doesn't say anything about it. I see that NSTableView has a setSortDescriptors method, NSTableColumn has a setSor

Re: sorting an NSTableView

2008-05-30 Thread Vijay Malhan
An Example: mTable = member instance for your TableView mData = member array which provides the data-objects. Put the following code at a place where your table and data-source array is initialized. Like in awakeFromNib: method. Here I'm sorting on key "name", Change it to whatever key you ha

sorting an NSTableView

2008-05-29 Thread James W. Walker
Hi. I'm a Cocoa newbie, and I'm trying to figure out how to enable sorting columns of my table, but the NSTableView guide doesn't say anything about it. I see that NSTableView has a setSortDescriptors method, NSTableColumn has a setSortDescriptorPrototype method, and that IB shows a "sort