NSTableView, NSArrayController, and ImageAndTextCell
NSTableView, NSArrayController, and ImageAndTextCell
- Subject: NSTableView, NSArrayController, and ImageAndTextCell
- From: Kurt Marek <email@hidden>
- Date: Fri, 7 Nov 2003 21:11:10 -0800
I'm trying to get an icon next to the text in my tableView. I've
downloaded Apple's ImageAndTextCell and I'm trying to get it to work
with a tableView that is bound to an NSArrayController. I haven't been
able to get it to work yet; has anyone else had success with this?
Here's the strategy I'm trying. The NSArrayController controls an array
of custom classes consisting of two instance variables: objectTitle and
objectITCell (an instance of the ImageAndTextCell). I bound the column
in my tableView to NSArrayController selection.objectITCell. I can set
the image in the objectITCell instance programatically and I can get
the table to add records and edit the cell, but I can't get the cell to
display the image and the text. Although I assumed that setting up the
binding this way would tell the column to expect this specialized cell
type, I also tried to set it manually:
NSTableColumn *tableColumn = nil;
ImageAndTextCell *imageAndTextCell = nil;
tableColumn = [sourceTableView tableColumnWithIdentifier: @"Source"];
imageAndTextCell = [[[ImageAndTextCell alloc] init] autorelease];
[imageAndTextCell setEditable: YES];
[tableColumn setDataCell:imageAndTextCell];
This doesn't seem to help either. Any help?
Kurt
_______________________________________________
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.