Re: A documentation dumdum
Re: A documentation dumdum
- Subject: Re: A documentation dumdum
- From: Jens Alfke <email@hidden>
- Date: Sun, 22 Jun 2008 09:22:45 -0700
On 22 Jun '08, at 9:13 AM, Jeff LaMarche wrote:
Whatever the object is, it will be converted to a string for
display, but the table view is actually capable of holding different
types of data and doesn't change the type that it's holding, so you
can't assume that the object it holds is a string.
Specifically, the object you get comes from the table cell for that
column, and is of whatever value type that cell class uses. It depends
on the type of cell.
This is the same situation as the more common -
objectValueForTableColumn: method, but in reverse. In that method you
have to return an object that will be stored as the object value for
the cell, so it has to be a type that cell can work with. In the -
setObjectValue: method, the cell returns you a value of its native
type, and you have to work with it.
Here are a few examples to give you an idea of what object classes the
various cells will give you. The documentation for each NSCell
subclass will describe this.
text field — NSString [unless you've attached an NSNumberFormatter or
NSDateFormatter, in which case it's an NSNumber or NSDate]
checkbox or other NSButton — NSNumber with a boolean value,
corresponding to the -state property
slider — NSNumber
pop-up menu — NSNumber (the index of the selected item)
image — NSImage
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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