Re: remove all columns and enable sorting.
Re: remove all columns and enable sorting.
- Subject: Re: remove all columns and enable sorting.
- From: Matt Neuburg <email@hidden>
- Date: Fri, 04 Aug 2006 11:42:33 -0700
- Thread-topic: remove all columns and enable sorting.
On Fri, 4 Aug 2006 11:24:36 -0400, Brian Weitzner <email@hidden> said:
> what I want to
>do is remove all the columns before it starts to add the new ones, so
>the results of previous queries aren't being displayed. Is there a
>good way to do this?
Read. The. Documentation.
NSTableView's tableColumns gives you a list of all the table columns. Now
remove them, one by one.
> I know about removeTableColumn: but then the
>problem becomes how do I get the names of the NSTableColumn to be
>removed?
Clearly you do NOT know about removeTableColumn:, since it doesn't require a
name. It requires an NSTableColumn*, which is exactly what tableColumns
gives you a list of.
>Also, I would like to be able to sort this data. I read through the
>Sorting NSTableView thread from a few days ago, and I must admit, it
>seemed a little bit over my head. Unfortunately, I cannot figure out
>how to enable sorting completely programmatically. The solution
>posted involved setting sort keys in IB, which I cannot do. Does
>anyone know how to do this?
It all depends on (a) at what point you want to sort [do you want to sort
the actual data as assembled in the backing store, or do you want to sort
its presentation in the table view?] and (b) how you are supplying the data
to the table. You don't give any information, so you can't receive specific
advice. However, for one way to get started, read the documentation on
setSortDescriptors: and NSSortDescriptor. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
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