Re: NSTokenField: "value" binding hijacks down-arrow key [Punted]
Re: NSTokenField: "value" binding hijacks down-arrow key [Punted]
- Subject: Re: NSTokenField: "value" binding hijacks down-arrow key [Punted]
- From: Jerry Krinock <email@hidden>
- Date: Thu, 19 Jul 2012 13:19:29 -0700
On 2012 Jul 18, at 09:12, Jerry Krinock wrote:
> • "value" binding of an NSTokenField bound is bound via an object controller to an array property of a model object.
> • -tokenField:completionsForSubstring:indexOfToken:indexOfSelectedItem: is implemented to show completions.
>
> The completions menu shows, but when user hits the down-arrow key, instead of stepping into the completions menu, the token ends editing immediately, setting its value to the first completion in the menu.
>
> Problem seems to be related to the "value" binding, because without this binding the down-arrow key steps into the completions menu as expected. Works the same with or without the binding options (No Selection, Multiple Values, etc.). Also works the same with either binding in Interface Builder or in code.
For some reason, if I implement a cheesy "helper" attribute in the window controller, and bind the token field's "value" to this, bypassing the object controller, the problem is solved.
I tried to reproduce the problem in a small test project, but its completions menu always works as expected, with or without the object controller. The explanation may be that, in the real project, the binding is to a special "multi-object" object which I have designed to merge attributes for multiple selections, via -(set)valueForUndefinedKey:.
But all this trouble is in 10.7, and with 10.8 on the way, the boss says I should ship with the cheesy "helper" attribute workaround and move on. Sorry :)
_______________________________________________
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