Re: Bindings: Allows Editing Multiple Values Selection
Re: Bindings: Allows Editing Multiple Values Selection
- Subject: Re: Bindings: Allows Editing Multiple Values Selection
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Tue, 20 May 2008 10:44:00 +0200
On 20 May 2008, at 01:50, Ken Thomases wrote:
This is an example where the reference documentation doesn't guide
you to the relevant conceptual documentation very well.
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.
[...]
Here's a starting point: http://developer.apple.com/documentation/
Cocoa/Conceptual/CocoaBindings/Concepts/CntrlSelection.html#//
apple_ref/doc/uid/TP40002146-187723
Or, for someone who prefers to read the on-disk documentation:
Article: "Working With a Controller’s Selection" in the "Cocoa
Bindings Programming Topics" in "Guides: Cocoa - Design Guidelines".
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.
These explanations have helped my understanding a lot. Thank you very
much!
Kind regards,
Gerriet.
_______________________________________________
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