Re: NSTableView, NSArrayController, and ImageAndTextCell
Re: NSTableView, NSArrayController, and ImageAndTextCell
- Subject: Re: NSTableView, NSArrayController, and ImageAndTextCell
- From: mmalcolm crawford <email@hidden>
- Date: Sat, 8 Nov 2003 01:45:01 -0800
On Nov 8, 2003, at 1:37 AM, Alastair Houghton wrote:
It's cleaner IMHO to write the cell's -setObjectValue to accept an
object that contains both text and an image (you could use an NSArray
with two elements, or you could use a custom container object of some
type). That way you don't have to set the image or the text in your
willDisplayCell: method... you just do it the usual way, by returning
your object from objectValueForTableColumn: method.
I see no reason why that wouldn't work with NSArrayController.
Indeed -- that was my original suggestion ("If the value contained both
the text and the image (for example in a dictionary) that would work
(assuming the ImageAndTextCell knew the keys to use to extract the
information from the dictionary)."), and it wouldn't suffer from
potential problems with arranged arrays. The reason for introducing
the second example is that's how the on-disk example is implemented:
<file:////Developer/Examples/AppKit/DragNDropOutlineView/>
mmalc
_______________________________________________
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.