Re: NSTableView, NSArrayController, and ImageAndTextCell
Re: NSTableView, NSArrayController, and ImageAndTextCell
- Subject: Re: NSTableView, NSArrayController, and ImageAndTextCell
- From: Alastair Houghton <email@hidden>
- Date: Sat, 8 Nov 2003 11:02:41 +0000
On 8 Nov 2003, at 09:59, Vincent Coetzee wrote:
Hi Alistair
I would suspect that using a subclass of NSCell, and asking that to
retrieve it's own object value and then drawing appropriately would
work in a much cleaner fashion, HOWEVER, my understanding of
setObjectValue: is that it is used to store some sort of semantic
object that the cell represents rather than the actual parameters
required by the cell itself, and hence I would think that the
implementation using it's own object value may well cause re-use
problems somewhere down the line.
I can't see any re-use problem there. NSCells aren't supposed to be
storing your data... they're part of the View part of MVC. They do, as
a matter of fact, have a couple of other methods you can use to easily
remember which bit of data corresponds to which NSCell (I presume that
was what you meant by "semantic object", above?); take a look at
-representedObject and -setRepresentedObject: if that's what you're
after. But the -objectValue and -setObjectValue: can be anything you
want.
It's rather ironic that you're worried about re-use for a cell that
displays an image and some text, given the number of times this list
has been asked how to do that!
Kind regards,
Alastair.
_______________________________________________
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.