Re: NSOutlineView with NSImage and NSStrings
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