Organization of This Document
See Also
This document describes the NSKeyValueCoding
informal protocol which defines a mechanism allowing applications to access the properties of an object indirectly by name (or key), rather than directly through invocation of an accessor method or as instance variables.
You should read this document to gain an understanding of how to use key-value coding in your applications and how to make your classes key-value coding compliant for interacting with other techonologies. Key-value coding is a key technology when working with key-value observing, Cocoa bindings, Core Data, and making your application AppleScript-able. You are expected to be familiar with the basics of Cocoa development, including the Objective-C language and memory management.
Key-Value Coding includes these articles:
“What is Key-Value Coding?” provides an overview of key-value coding.
“Terminology” defines the terms commonly used to refer to an object’s properties.
“Key-Value Coding Fundamentals” describes the basic principles required to use key-value coding.
“Key-Value Coding Accessor Methods” describes the accessor methods your classes should implement.
“Key-Value Validation” tells you how to implement property validation.
“Ensuring KVC Compliance” describes the capabilities a class must implement to be key-value coding compliant.
“Scalar and Structure Support” describes the data types supported by key-value coding.
“Set and Array Operators” lists the available collection operators and describes their use.
“Accessor Search Implementation Details” explains how the appropriate accessor method or instance variable is determined.
“Describing Property Relationships” describes the use of meta-data to define the relationships between objects and their properties.
“Performance Considerations” describes the performance considerations when using key-value coding.
There are other technologies, not covered in this document, that are related to key-value coding.
Key-Value Observing Programming Guide describes the features of the key-value observing protocol that allows objects to observe changes in other objects.
© 2003, 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-02-04)