• 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
Images & Alternate Color Rows In Table
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Images & Alternate Color Rows In Table


  • Subject: Images & Alternate Color Rows In Table
  • From: email@hidden
  • Date: Fri, 19 Jul 2002 22:44:05 +0100 (BST)

email@hidden,

I'm trying to setup my NSTableView to alternate its row color. The code I have written seems to work provided there are no columns with images in. If there are images in the columns I get the following build error:

2002-07-19 20:46:01.097 SetTheTableView[328] *** -[NSImageCell setDrawsBackground:]: selector not recognized
2002-07-19 20:46:01.105 SetTheTableView[328] An uncaught exception was raised
2002-07-19 20:46:01.105 SetTheTableView[328] *** -[NSImageCell setDrawsBackground:]: selector not recognized
2002-07-19 20:46:01.106 SetTheTableView[328] *** Uncaught exception: <NSInvalidArgumentException> *** -[NSImageCell setDrawsBackground:]: selector not recognized

Here is my code:

- (void) tableView: (NSTableView *) aTableView willDisplayCell: (id) cell
forTableColumn: (NSTableColumn *) aTableColumn row: (int) row {

[cell setFont: [NSFont fontWithName: @"Lucida Grande" size: 11]];

if (row % 2 == 0) {
[cell setDrawsBackground: YES];
[cell setBackgroundColor: [NSColor colorWithCalibratedRed: 0.95 green: 0.95 blue: 1.0 alpha: 1.0]];
}
else {
[cell setBackgroundColor: [NSColor whiteColor]];
[cell setDrawsBackground: NO];
}
}

Can someone help me adapt my code so it works with images in the columns. ( the images are in the first column if that helps)

Thanks alot.
Luke
_______________________________________________
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.

  • Follow-Ups:
    • Re: Images & Alternate Color Rows In Table
      • From: David Martin <email@hidden>
  • Prev by Date: Re: Need help with PackageMaker/Installer
  • Next by Date: Re: Displaying "helper text" in empty text fields
  • Previous by thread: Thanks everyone!
  • Next by thread: Re: Images & Alternate Color Rows In Table
  • Index(es):
    • Date
    • Thread