NSKeyValueCoding
A mechanism by which you can access the properties of an object indirectly by name or key.
Overview
The basic methods for accessing an object’s values are setValue(_:forKey:), which sets the value for the property identified by the specified key, and value(forKey:), which returns the value for the property identified by the specified key. Thus, all of an object’s properties can be accessed in a consistent manner.
The default implementation relies on the accessor methods normally implemented by objects (or to access instance variables directly if need be).
Topics
Getting Values
value(forKey:)value(forKeyPath:)dictionaryWithValues(forKeys:)value(forUndefinedKey:)mutableArrayValue(forKey:)mutableArrayValue(forKeyPath:)mutableSetValue(forKey:)mutableSetValue(forKeyPath:)mutableOrderedSetValue(forKey:)mutableOrderedSetValue(forKeyPath:)
Setting Values
setValue(_:forKeyPath:)setValuesForKeys(_:)setNilValueForKey(_:)setValue(_:forKey:)setValue(_:forUndefinedKey:)
Changing Default Behavior
Validation
Deprecated Methods
useStoredAccessor()handleQuery(withUnboundKey:)handleTakeValue(_:forUnboundKey:)storedValue(forKey:)takeStoredValue(_:forKey:)takeValues(from:)takeValue(_:forKeyPath:)takeValue(_:forKey:)unableToSetNil(forKey:)values(forKeys:)
Constants
See Also
Related Documentation
- Key-Value Coding Programming Guide