• 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: NSOutlineView with NSImage and NSStrings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOutlineView with NSImage and NSStrings


  • Subject: Re: NSOutlineView with NSImage and NSStrings
  • From: Jerry Krinock <email@hidden>
  • Date: Mon, 4 May 2009 12:13:18 -0700


On 2009 May 01, at 14:59, iseecolors wrote:

I would like to have an image and a string together in my NSOutlineView, but it is not clear to me how to do this. Basically I want to do what iTunes appears to do (icons in front of the text descriptors).

My initial thought was to return and NSArray that contains and NSImage and NSString from the method:

- (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item

Good guess. Try overriding -[NSTableColumn dataCellForRow] instead, and returning an instance of your own custom subclass of NSCell. This has been discussed more than once, as recently as within the last couple weeks in the list archives.


But apparently the returned id is just converted to an NSString. (if it only deals with strings, why support id?)

Because your table is using the default NSTextFieldCell. Different cells will support different types.


You should read the document "Control and Cell Programming Topics for Cocoa" at developer.apple.com.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSOutlineView with NSImage and NSStrings (From: iseecolors <email@hidden>)

  • Prev by Date: Re: Make connections between One Button and two different NSObjects?
  • Next by Date: Re: Question of .png and 'transparency'
  • Previous by thread: Re: NSOutlineView with NSImage and NSStrings
  • Next by thread: NSOutlineView with NSImage and NSStrings
  • Index(es):
    • Date
    • Thread