Re: NSComboBox bug?
Re: NSComboBox bug?
On Thu, Oct 31, 2002 at 12:04:00PM -0800, matt neuburg wrote:
>
On 10/31/02 at roughly 1:50 PM, thus spake Nicholas Riley <email@hidden>:
>
>
>On Thu, Oct 31, 2002 at 11:29:52AM -0800, matt neuburg wrote:
>
>> >Nope, it's a bug that's been there since 10.0. You can't have a combo
>
>> >box with a formatter if you want the combo box to work.
>
>>
>
>> Piffle. Formatters work perfectly well with comboboxes; I use them
>
>> all the time. A combination of a formatter and a datasource is a
>
>> very powerful way to run a combobox.
>
>
>
>It would be lovely if it were documented somewhere.
>
>
What's not documented?
That the values added to a combo box with a formatter must be
instances of the class which the formatter produces, and if you don't
do this, instead of your getting an error message, the combo box
values simply don't show up at all.
That if you use one of the standard date or number formatters, you
can't edit the combo box list from IB.
This is an explicit design decision, one that I don't agree with.
Formatters work in two directions. Strings entered in IB should be
run through the formatter to produce an object, just as strings
entered in the combo box directly are processed. It should be
possible to do the same thing programmatically - add string values to
the combo box list which are processed by the formatter to produce
object values.
In this way, combo boxes work completely differently from menus (which
have string labels and represented objects) and table views (which let
you do anything you want from the data source). They end up being
much less flexible and harder to understand and use.
I can't just use a different formatter in Pester, because (with the
current, IMO broken, behavior) I want the formatter to do something
different in the menu (preserve natural-language dates) from the field
(expand natural-language dates).
--
=Nicholas Riley <email@hidden> | <
http://www.uiuc.edu/ph/www/njriley>
Pablo Research Group, Department of Computer Science and
Medical Scholars Program, University of Illinois at Urbana-Champaign
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.