Re: Line Numbers in Tables
Re: Line Numbers in Tables
- Subject: Re: Line Numbers in Tables
- From: Antonio Nunes <email@hidden>
- Date: Wed, 29 Aug 2007 21:57:43 +0100
On 29 Aug 2007, at 17:07, Gordon Apple wrote:
Simple function -- apparently no simple solution. I just want
to put
line numbers in one column of a table. I want them to start at "1"
and stop
at the last table entry. Nothing I've tried works and I've searched
available resources.
This is what works for me:
I bind the value binding of the line number column of the tableview
to the relevant arraycontroller using a path to a method implemented
in the object controlled by the controller". (Wow, wasn't that a
mouthful! In short, something like: value = arrangedIndex.listIndex
[YourController].)
The method in your controller object can be something to the extent of:
- (unsigned)listIndex
{
return [myArrayObject indexOfObject:self] + 1;
}
Good luck!
António
----------------------------------------------------
There is a world of difference between
searching for happiness and choosing
to be happy.
----------------------------------------------------
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden