Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I blogged about this in the context of MonoMac, the peer project to MonoTouch but used for building Mac applications:</p> <p><a href="http://tirania.org/monomac/archive/2010/Dec-07.html">http://tirania.org/monomac/archive/2010/Dec-07.html</a></p> <blockquote> <p>Key-Value Coding is a set of practices that allow applications to access object properties using strings. This is similar to Binding Expressions in Silverlight. In both cases the purpose is to allow tooling that does not directly have access to your native code to access properties from your program.</p> </blockquote> <p>In particular, this is useful because some APIs can take advantage of this. For example CoreAnimation can animate properties given their "path" to the object. For example, you can do:</p> <pre><code>var animateX = CAKeyFrameAnimation.FromKeyPath ("position.x"); pos.Values = new NSNumber [] { 0, 10, 60 }; layer.AddAnimation (animateX, "move"); </code></pre> <p>The "position.x" in this case references the layer's position, and within that position it's X component.</p> <p>The blog post above goes into more detail about how you can actually expose your own objects to participate in this protocol (registering your own properties to make them visible to the Key-Value-Coding system).</p> <p>Kenneth, another one of the MonoMac developers blogged about this extensively here:</p> <p><a href="http://cocoa-mono.org/archives/153/kvc-kvo-and-cocoa-bindings-oh-my-part-1/">http://cocoa-mono.org/archives/153/kvc-kvo-and-cocoa-bindings-oh-my-part-1/</a></p> <p>In particular he deals with the similarities with Reflection and he shows you how to use [Export] to turn your C# code into KVC compliant code as well.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload