Question about KVC-compliance and bindings
Question about KVC-compliance and bindings
- Subject: Question about KVC-compliance and bindings
- From: Per Bull Holmen <email@hidden>
- Date: Tue, 28 Feb 2012 16:24:26 +0100
Hi
Suppose I want to make a controller, which allows a view to bind to the keyPath:
mainBranch.subBranch.attribute
There will be a large range of theoretical subBranch.attribute
combinations, but only a few of these will actually be bound to by the
user. Other combinations will therefore be uninteresting. The
attributes will be read-only and mostly static, values like
minValue/maxValue or isEditable. No actual control values. Suppose it
is much easier for me to have my controller produce these attributes
on-the-fly, in valueForKeyPath:, than to produce a tree structure to
hold all the information. The attributes will rarely change (typically
once per session), and when they do, the entire mainBranch will be
switched out.
My question is: Must I ensure KVC-compliance for every subpath of the
key path? So that querying the controller for mainBranch.subBranch
MUST return a KVC-compliant object with all the attributes, and
querying for only mainBranch MUST return an object that can be queried
for subBranch.attribute, or only subBranch etc...? Even if it doesn't
make sense to bind anything to these subpaths?
Per
_______________________________________________
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