• 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: Editing and displaying different values in table cells
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Editing and displaying different values in table cells (From: Matthew Roberts <email@hidden>)

  • Prev by Date: Praise for the many AppKit enhancements
  • Next by Date: Re: 2 interface questions
  • Previous by thread: Editing and displaying different values in table cells
  • Next by thread: Re: Editing and displaying different values in table cells
  • Index(es):
    • Date
    • Thread