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

Re: ImageInTableview


  • Subject: Re: ImageInTableview
  • From: Stefan Schüßler <email@hidden>
  • Date: Sun, 10 Aug 2003 22:44:48 +0200

You have to set the cell to an NSImageCell. In awakeFromNib get the
appropriate column using NSTableView's tableColumnWithIdentifier:
method and set the type using NSTableColumn's setDataCell: method.

Stefan

Am Sonntag, 10.08.03 um 22:06 Uhr schrieb Mathew Peterson:

I want to place a small image in a tableview row for a certain column when its called. This is the code I am using but its simply sending me a description of the image (sure, the image is there...just not in the right form).

How can I make the image display correctly?

- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
{
if ([[aTableColumn identifier] isEqualToString:@"icon"])
{
return([NSImage imageNamed:@"library"]);
}
return([item objectAtIndex:rowIndex]);
}

Thanks,

Mat
_______________________________________________
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.
_______________________________________________
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: 
 >ImageInTableview (From: Mathew Peterson <email@hidden>)

  • Prev by Date: Looking for clarification on Applescript event handlers
  • Next by Date: Re: Setting focus to text field in drawer
  • Previous by thread: Re: ImageInTableview
  • Next by thread: Re: ImageInTableview
  • Index(es):
    • Date
    • Thread