![]() |
Couchbase Lite
Objective-C API for iOS and Mac OS
|
A generic class with runtime support for dynamic properties.
You can subclass this and declare properties in the subclass without needing to implement them or make instance variables; simply note them as '@dynamic' in the @implementation. The dynamic accessors will be bridged to calls to -getValueOfProperty: and setValue:ofProperty:, allowing you to easily store property values in an NSDictionary or other container.
Instance Methods | |
| (id) | - getValueOfProperty: |
| Returns the value of a named property. More... | |
| (BOOL) | - setValue:ofProperty: |
| Sets the value of a named property. More... | |
Class Methods | |
| (NSSet *) | + propertyNames |
| Returns the names of all properties defined in this class and superclasses up to CBLDynamicObject. More... | |
| (Class) | + classOfProperty: |
| Given the name of an object-valued property, returns the class of the property's value. More... | |
| (NSString *) | + getterKey: |
| (NSString *) | + setterKey: |
| (IMP) | + impForGetterOfProperty:ofClass: |
| (IMP) | + impForSetterOfProperty:ofClass: |
| (IMP) | + impForGetterOfProperty:ofProtocol: |
| (IMP) | + impForSetterOfProperty:ofProtocol: |
| (IMP) | + impForGetterOfProperty:ofType: |
| (IMP) | + impForSetterOfProperty:ofType: |
| + (NSSet*) propertyNames |
Returns the names of all properties defined in this class and superclasses up to CBLDynamicObject.
| - (id) getValueOfProperty: | (NSString *) | property |
Returns the value of a named property.
This method will only be called for properties that have been declared in the class's @interface using @property. You must override this method – the base implementation just raises an exception.
Implemented in CBLModel.
| - (BOOL) setValue: | (id) | value | |
| ofProperty: | (NSString *) | property | |
Sets the value of a named property.
This method will only be called for properties that have been declared in the class's @interface using @property, and are not declared readonly. You must override this method – the base implementation just raises an exception.
| + (Class) classOfProperty: | (NSString *) | propertyName |
Given the name of an object-valued property, returns the class of the property's value.
Returns nil if the property doesn't exist, or if its type isn't an object pointer or is 'id'.
| + (NSString*) getterKey: | (SEL) | sel |
| + (NSString*) setterKey: | (SEL) | sel |
| + (IMP) impForGetterOfProperty: | (NSString *) | property | |
| ofClass: | (Class) | propertyClass | |
| + (IMP) impForSetterOfProperty: | (NSString *) | property | |
| ofClass: | (Class) | propertyClass | |
| + (IMP) impForGetterOfProperty: | (NSString *) | property | |
| ofProtocol: | (Protocol *) | propertyProtocol | |
| + (IMP) impForSetterOfProperty: | (NSString *) | property | |
| ofProtocol: | (Protocol *) | propertyProtocol | |
| + (IMP) impForGetterOfProperty: | (NSString *) | property | |
| ofType: | (const char *) | propertyType | |
| + (IMP) impForSetterOfProperty: | (NSString *) | property | |
| ofType: | (const char *) | propertyType | |