• 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: 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.

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>)

  • Prev by Date: Re: NSTableView, NSArrayController, and ImageAndTextCell
  • Next by Date: Re: NSTableView, NSArrayController, and ImageAndTextCell
  • Previous by thread: Re: NSTableView, NSArrayController, and ImageAndTextCell
  • Next by thread: Re: NSTableView, NSArrayController, and ImageAndTextCell
  • Index(es):
    • Date
    • Thread