• 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: NSTableView, NSArrayController, and ImageAndTextCell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >NSTableView, NSArrayController, and ImageAndTextCell (From: Kurt Marek <email@hidden>)
 >Re: NSTableView, NSArrayController, and ImageAndTextCell (From: mmalcolm crawford <email@hidden>)
 >Re: NSTableView, NSArrayController, and ImageAndTextCell (From: Alastair Houghton <email@hidden>)
 >Re: NSTableView, NSArrayController, and ImageAndTextCell (From: Vincent Coetzee <email@hidden>)

  • Prev by Date: Re: NSTableView, NSArrayController, and ImageAndTextCell
  • Next by Date: Archiving performance (was: Re: (no subject))
  • Previous by thread: Re: NSTableView, NSArrayController, and ImageAndTextCell
  • Next by thread: Re: NSTableView, NSArrayController, and ImageAndTextCell
  • Index(es):
    • Date
    • Thread