Re: Editing and displaying different values in table cells
Re: Editing and displaying different values in table cells
- Subject: Re: Editing and displaying different values in table cells
- From: Itrat Khan <email@hidden>
- Date: Thu, 6 Nov 2003 13:48:09 -0500
On Thursday, November 6, 2003, at 12:49 PM, Matthew Roberts wrote:
I've got a column in a table that displays number of points earned on
an
academic assignment. The column is editable so the user can change the
number of points a student earned.
What I would like, though, is to have it so that the column displays
both
the number of points, but also an indication of the percentage score
(perhaps in gray text--which I can do with attributedStrings).
However,
when the user edits the cell, the percentage value must disappear and
the
only editable information must be the number of points.
Yes, this is possible. Define an NSFormatter subclass such as
NSTestScoreFormatter, and implement stringForObjectValue: to return a
string that combines the score and percentage. Then, override
editingStringForObjectValue: to return just the score without the
percentage, which will be displayed only when editing the cell.
Regards,
Itrat.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.