ObjFW
|
A protocol for Key Value Coding. More...
#import <ObjFW/OFKeyValueCoding.h>
Inherited by OFObject(KeyValueCoding).
Instance Methods | |
(nullable id) | - valueForKey: |
Returns the value for the specified key. More... | |
(nullable id) | - valueForUndefinedKey: |
This is called by valueForKey: if the specified key does not exist. More... | |
(void) | - setValue:forKey: |
Set the value for the specified key. More... | |
(void) | - setValue:forUndefinedKey: |
This is called by setValue:forKey: if the specified key does not exist. More... | |
(void) | - setNilValueForKey: |
This is called by setValue:forKey: if the specified key is a scalar, but the value specified is nil . More... | |
A protocol for Key Value Coding.
Key Value Coding makes it possible to access properties dynamically using the interface described by this protocol.
- (void) setNilValueForKey: | (OFString *) | key |
This is called by setValue:forKey: if the specified key is a scalar, but the value specified is nil
.
By default, this throws an OFInvalidArgumentException.
key | The key for which the value nil was specified |
- (void) setValue: | (id) | value | |
forKey: | (OFString *) | key | |
Set the value for the specified key.
value | The value for the specified key |
key | The key of the value to set |
- (void) setValue: | (nullable id) | value | |
forUndefinedKey: | (OFString *) | key | |
This is called by setValue:forKey: if the specified key does not exist.
By default, this throws an OFUndefinedKeyException.
value | The value for the specified undefined key |
key | The undefined key of the value to set |
- (nullable id) valueForKey: | (OFString *) | key |
Returns the value for the specified key.
key | The key of the value to return |
- (nullable id) valueForUndefinedKey: | (OFString *) | key |
This is called by valueForKey: if the specified key does not exist.
By default, this throws an OFUndefinedKeyException.
key | The undefined key of the value to return |