Organization of This Document
See Also
Key-value coding provides a mechanism for accessing an object’s properties indirectly.
The techniques for using key-value coding differ slightly between Objective-C and Java. Key-value coding in Objective-C is largely managed by the NSKeyValueCoding informal protocol, which is implemented by the NSObject class. Only two methods from this protocol are available in Java. Instead, in Java most key-value coding is implemented in the NSKeyValue class.
You should read this document to gain an understanding of how to use key-value coding in your applications. Key-value coding is a key technology when working with Cocoa bindings and Core Data. 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.
Last updated: 2007-06-06