• 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: NSTableView and tableViewWillDisplayCell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView and tableViewWillDisplayCell


  • Subject: Re: NSTableView and tableViewWillDisplayCell
  • From: email@hidden
  • Date: Sun, 30 Sep 2001 21:27:24 -0400

On Sunday, September 30, 2001, at 08:21 PM, Simon Wright wrote:

> public void tableViewWillDisplayCell(NSTableView aTableView, NSCell
> aCell, NSTableColumn aTableColumn, int rowIndex) {
> NSApplication.beep(); //let me know if it's getting called
> if
> (aTableColumn.identifier().toString().equals("statusColumn")) {
> if (statusArray.objectAtIndex(rowIndex) == "")
> aCell.setImage(statusGoodImage);
> else
> aCell.setImage(statusBadImage);
> }
> }


I'm not entirely sure about this really - but it looks like you aren't
returning the image unless you just left this out of your description of
the error. You want to implement this in your dataSource class:

public Object tableViewObjectValueForLocation(NSTableView tv,
NSTableColumn tc, int i)
{
try{
if(tc.identifier().toString().equals("statusColumn"))
{
if(statusArray.objectAtIndex(rowIndex) == "")
return statusGoodImage;
else
return statusBadImage;
}
}
catch(Exception e)
{ /* this whole try catch block is from another example - but i
don't have the 10.1 tools yet - so i didn't know what to remove and just
typed this in by hand. */
return "Exception (could be unlabeled identifier in IB)";
}
}


like i mention in the comment above - this is typed in to mail.app - so
there might be some bugs - but it should help...

good luck,
Tyler


References: 
 >NSTableView and tableViewWillDisplayCell (From: Simon Wright <email@hidden>)

  • Prev by Date: Precision of double
  • Next by Date: Re: Odd stuff with Cocoa-Java
  • Previous by thread: NSTableView and tableViewWillDisplayCell
  • Next by thread: Precision of double
  • Index(es):
    • Date
    • Thread