Key-Value Observing (KVO) and Key-Value Coding (KVC) are two very important concepts in Objective-C and are vital if you want to use technologies such as bindings or Core Data in your projects.
Keys and Values
Objects in Objective-C can have instance variables, or attributes, that help define the state of the object. A "Recipe" object might have instance variables of "name" (an
NSString), "preparationTime" (perhaps an
NSTimeInterval), a list of "ingredients" (probably an
NSArray pointing to separate Ingredient objects), and so forth.
The name of these variables ("name", "preparationTime", "ingredients") is the key, while the data they hold are the value. The idea is roughly equivalent to an
NSDictionary, which holds data (values) based on reference objects (keys).
Keys, when talking about KVO and KVC, are always strings. That is, they are a sequence of characters that match the name of the variable.
@"name" would be the key of the "name" property of the recipe, and its value might be something like "Dave's Amazing Guacamole".
This ability to refer to variables by their key is very powerful. It was the driving concept behind bindings.
Introduction to Key-Value Coding Programming Guide