Re: Bindings: Allows Editing Multiple Values Selection
Re: Bindings: Allows Editing Multiple Values Selection
- Subject: Re: Bindings: Allows Editing Multiple Values Selection
- From: Ken Thomases <email@hidden>
- Date: Mon, 19 May 2008 18:50:25 -0500
This is an example where the reference documentation doesn't guide
you to the relevant conceptual documentation very well.
On May 19, 2008, at 5:46 AM, Gerriet M. Denkmann wrote:
Trying to change this, to get some understanding, I looked at the
check boxes kindly offered by InterfaceBuilder.
The first one is: "Allows Editing Multiple Values Selection" -
which is checked.
So I typed "Multiple" into AppKiDo. Got several hits, but nothing
relating to "Allows Editing Multiple Values Selection".
So selected NSObjectController -> 1. General -> Inheritance and
found a link to the "Cocoa Bindings Programming Topics".
Clicked, and viewed it in Safari. See a list of Articles, but none
of these seems to be related to "Allows Editing Multiple Values
Selection".
Tried "Find", but Sarari can only search the current page.
[Woebegone reminiscences of the DigitalLibrarian of NeXTStep - but
this does not help me today].
Ok, use todays tools: Xcode -> Help -> Documentation. Type "Allows
Editing Multiple Values Selection" got nothing in either Api or
Full Text Search. Well.
IB uses the plural "Values" in its interface, while the singular
"Value" is used in numerous places in the docs. That's annoying.
Next: Spotlight - and got about 200 html documents. Usually there
are millions of things all called index.html, but today I am lucky:
there is one called "BindingOptions.html", which is an Article in
"Cocoa Bindings Reference".
This mentions
"NSAllowsEditingMultipleValuesSelectionBindingOption", and Xcode
Help points to the "NSKeyValueBindingCreation Protocol Reference"
Spotlight shows me also "/Developer/ADC Reference Library/
releasenotes/Cocoa/AppKit.html", which mentions this flag with
arrays. Obviously not interesting, as I just have one TextField.
One text field can be bound to an array. Imagine a list of things on
the left and a text field on the right. The list has Person objects
and the text field shows that person's street address. If you have a
single Person, the text field will show just that one person's
address. Editing the content of that text field makes clear sense.
What if you select multiple Persons in the list? What should the
text field show and what should be the result of editing in that field?
But all I have found so far is: the flag
NSAllowsEditingMultipleValuesSelectionBindingOption or the checkbox
"Allows Editing Multiple Values Selection" "determines if the
binding allows editing when the value represents a multiple
selection."
Is this really an explanation, or just a rephrase?
And: how can the value (some simple integer in my case) "represent
a multiple selection"?
Bindings are very general. They only have a key path -- a string --
to tell them what they're bound to. IB can't tell what sort of thing
that key path will resolve to at runtime. So, there will be options
which are not necessarily appropriate for every case.
Since your text field is bound to a simple integer, then it can't
represent a multiple selection. So, the grammar of the explanation
suggests that the setting isn't relevant in your case.
So what conclusions should I draw from this:
a) the answer is extremely obvious and I am just plain stupid.
Nope. :)
b) the documentation is less than perfect.
Absolutely!
To summarize:
1. AppKiDo is very helpful
2. Xcode -> Help -> Documentation is only marginally useful
3. Not being able to do a global search in a conceptional Guide is
a severe handicap.
The explanation I am craving for might not belong into a Reference
document.
But then a link to the appropriate section of the conceptional
Guide would be very helpful.
Here's a starting point: http://developer.apple.com/documentation/
Cocoa/Conceptual/CocoaBindings/Concepts/CntrlSelection.html#//
apple_ref/doc/uid/TP40002146-187723
That provides context for discussion of the binding option you were
trying to look up. If your text field were bound to some
controller's selection.name key path, and that key path resulted in
multiple values, should the text field allow editing or not? If it
does allow editing, then the user may change the name of a group of
objects all at once. If it doesn't, then your GUI requires that your
user select a single object before s/he may edit its name. It's your
choice.
Regards,
Ken
_______________________________________________
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