- (unsigned)lineNumber
{
unsigned result = ++_lineNumber; // increment each time we are
asked, which is once per row
if (_lineNumber == [self numberOfRows]) // when at the last row we
ned to reset the line number
_lineNumber = 0;
return result;
}
@end
2. Bind the desired table view's column to its table view's
lineNumber property.
I created a little test project and it works a treat. The project
also shows how to sort numbers in strings numerically (rather then
alphabetically). To find the project take a break here: http://
web.mac.com/antonionunes/
If this latest code still is offensive do let me know. :-)
This approach doesn't look good to me. You're relying on an
implementation detail that may change in future and it wouldn't
surprise me if there were some circumstances where the approach above
doesn't work.
_______________________________________________
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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden
This email sent to email@hidden