Re: NSComboBoxCell & AutoComplete
Re: NSComboBoxCell & AutoComplete
- Subject: Re: NSComboBoxCell & AutoComplete
- From: Quincey Morris <email@hidden>
- Date: Sun, 09 Oct 2011 21:56:52 -0700
On Oct 9, 2011, at 17:18 , email@hidden wrote:
> I have an NSComboBox bound to the selection of an NSArrayController. The bound object is an NSDictionary. I use an NSValueTransfomer to represent the NSDictionary. The ValueTransformer gives me the dictionary's summary property which is useful for people choosing the appropriate NSDictionary from the array. I have set up the NSComboBox to use a datasource for custom autocompletion. I need case insensitive autocompletion which does not come straight of the box. Whenever I star typing in my NSComboBox, I get an -[NSDictionary length] exception. The NSComboxCell is trying to complete by sending a length request to the bound object, not through the transformer. Is there a way around this? The calling method before the exception is [NSComboBoxCell _completeNoRecursion]. Thanks,
There's not really enough information here to diagnose anything, except that you refer to "choosing … from the array". That leads me to suspect you're (wrongly) trying to use the NSComboBox as a kind of menu. It's not -- it's a kind of text field, an editable one. What you're doing (it sounds like) is asking to edit the dictionary's summary property, which doesn't sound sensible, and trying to customize the autocompletion behavior is probably just making things worse.
If you're trying to let the user choose one of an existing array of things, use a NSPopUpButton instead, or some other variant of an actual menu. If you also want the user to type-select things, then consider using a NSTableView.
_______________________________________________
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