NSTokenField
NSTokenField
- Subject: NSTokenField
- From: Guy English <email@hidden>
- Date: Fri, 26 Aug 2005 14:50:42 -0400
Hi everyone,
NSTokenField is ... annoying me. First it doesn't seem like you can size it any higher than one line and have it work correctly. Second I can't seem to find a way to programmatically insert tokens. [tokenField setStringValue: @"this, is, annoying"] doesn't tokenize the string. Ditto for the value binding. Further if I click in the field and edit it it *also* doesn't tokenize the string. Unless I press Enter with the insertion point over each token in turn.
And then, wanting to make sure I'd covered the bases before bitching publicly, I checked the release notes ...
"Use NSControl/NSCell's setObjectValue: method to set the token field's array of represented objects. If the array contains objects other than NSStrings, you must implement the tokenField:displayStringForRepresentedObject: delegate method."
So, ok, mea culpa. I can't try this right now but I assume it works perfectly. A couple of things are annoying about this though. First, it'd be nice to document the behaviour of setObjectValue in the NSTokenField docs (radar 4233801). Second, and this may be debatable, the 'value' binding doesn't do what you likely want it to do. And there is no 'objectValue' binding exposed.
Anyway, I wasn't going to send this mail after I found the Release Notes but I think it's worth having in the archives in case anyone else is struggling with this.
Take care,
Guy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden