Re: index column in bound NSTableView
Re: index column in bound NSTableView
- Subject: Re: index column in bound NSTableView
- From: Alex Rosenberg <email@hidden>
- Date: Mon, 24 Jan 2005 08:30:42 -0800
On Jan 23, 2005, at 10:50 AM, Matt Neuburg wrote:
On Fri, 21 Jan 2005 14:37:09 -0800, Alex Rosenberg <email@hidden>
said:
Given an NSTableView using bindings, is there a simple way to add a
column of the original array index numbers?
The numbers should properly jumble when the the table is sorted.
The array is presumably an array of something - like, mutable
dictionaries.
So I would write a routine that runs through the array, and adds to
each
mutable dictionary a key-value pair whose key corresponds to the extra
column in the table and whose value is the index number. m.
Unfortunately, it's never that simple. One would need to track all
rearrangements and walk through the entire thing and shift or reindex
it as objects are inserted/deleted/rearranged.
NSArrayController manages sorting/rearranging the objects. It seems
wrong to me to have the objects tracking their own positions. It seems
like NSArrayController (or a subclass of it) should do this.
+------------------------------------------------------------+
| Alexander M. Rosenberg <mailto:email@hidden> |
| Nobody cares what I say. Remove the underscore to mail me. |
_______________________________________________
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