Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Panther: New Table features (NSSortDescriptors)

Panther: New Table features (NSSortDescriptors)
Thread Tools
Junior Member
Join Date: Oct 2000
Location: Germany
Status: Offline
Reply With Quote
Feb 21, 2004, 01:40 PM
 
Hello,

does anybody know how the new features for Table sorting work.
I can't find any good information how to achieve this!

Here is what I am trying to do:
I have a tableView including a checkbox column, a text column and a popupmenu column. now when i click on the column header i want to sort the data in the tableView.
Can anybody please roughly explain how this would work. How can I use the NSSortDescriptor to sort? Why are there options for this in Interface Builder and how do they work? I am really confused, because in my opinion Apple doesn't provide enough documentation and/or examples on this topic.

Sincerely,
rudy norff
     
Junior Member
Join Date: Oct 2000
Location: Germany
Status: Offline
Reply With Quote
Feb 23, 2004, 05:51 AM
 
I now get how to use the new NSSortDescriptor stuff. I implemented the following code:

- (void)tableView:(NSTableView *)tableView sortDescriptorsDidChange:(NSArray *)oldSortDescriptors {
// arTasks is my Mutable Array
[arTasks sortUsingDescriptors: [tableView sortDescriptors]];
[self saveData]; // this just saves my array into a plist
[tableView reloadData];
}

The sorting works for all columns containing text. But when I select a column with the content being a number (I have some Popupmenus in my table) or when I select the column that contains booleans (I have checkboxes in that column) then it just says something like this:

[NSFCBoolean length]: selector not recognized

Does anybody have an idea wy this is happening? By the way: for every column I used the sort selector compare: in interface builder, this should work, right?

thanks for your answers in advance!
- rudy
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:01 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2