• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Question about KVC-compliance and bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Question about KVC-compliance and bindings
      • From: Keary Suska <email@hidden>
  • Prev by Date: Re: Accelerate/vDSP.h question
  • Next by Date: Re: Question about KVC-compliance and bindings
  • Previous by thread: Re: How to support larger NSView hierarchy?
  • Next by thread: Re: Question about KVC-compliance and bindings
  • Index(es):
    • Date
    • Thread