Created
February 10, 2015 17:56
-
-
Save brianmpalma/e82be9f3519d6e315df0 to your computer and use it in GitHub Desktop.
NSKeyValueCoding Informal Protocol
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NSKeyValueCoding | |
An informal protocol on NSObject. It provides an indirect way of setting values by key (property / iVar name) without using accessors or iVar access. | |
## Getting Values | |
``` | |
- valueForKey: | |
- valueForKeyPath: | |
- dictionaryWithValuesForKeys: | |
- valueForUndefinedKey: | |
- mutableArrayValueForKey: | |
- mutableArrayValueForKeyPath: | |
- mutableSetValueForKey: | |
- mutableSetValueForKeyPath: | |
- mutableOrderedSetValueForKey: | |
- mutableOrderedSetValueForKeyPath: | |
``` | |
## Setting Values | |
``` | |
- setValueForKey: | |
- setValueForKeyPath: | |
- setNilValueForKey: | |
- setValuesForKeysWithDictionary: | |
- setValue;forUndefinedKey: | |
``` | |
## Changing Default Behavior | |
``` | |
+ accessInstanceVariablesDirectly | |
``` | |
## Validation | |
``` | |
- validateValue:forKey:error: | |
- validateValue:forKeyPath:error: | |
``` | |
## Also Contains | |
The protocol also contains string constants for exceptions, error keys, and collection operators |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment