• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Line Numbers in Tables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Line Numbers in Tables
      • From: mmalc crawford <email@hidden>
References: 
 >Line Numbers in Tables (From: Gordon Apple <email@hidden>)

  • Prev by Date: Re: Line Numbers in Tables
  • Next by Date: Re: Line Numbers in Tables
  • Previous by thread: Re: Line Numbers in Tables
  • Next by thread: Re: Line Numbers in Tables
  • Index(es):
    • Date
    • Thread