RKMappingOperationDelegate Protocol Reference
| Conforms to | NSObject |
| Declared in | RKMappingOperation.h |
Overview
Objects acting as the delegate for RKMappingOperation objects must adopt the RKMappingOperationDelegate protocol. These methods enable the delegate to be notified of events such as the application of attribute and relationship mappings during a mapping operation.
Tasks
Other Methods
-
– mappingOperation:didFindValue:forKeyPath:mapping:Tells the delegate that an attribute or relationship mapping was found for a given key path within the data being mapped.
-
– mappingOperation:didNotFindValueForKeyPath:mapping:Tells the delegate that no attribute or relationships mapping was found for a given key path within the data being mapped.
-
– mappingOperation:shouldSetValue:forKeyPath:usingMapping:Asks the delegate if the mapping operation should set a value for a given key path with an attribute or relationship mapping. This method is invoked before the value is set. If the delegate does not implement this method, then the mapping operation will determine if the value should be set by comparing the current property value with the new property value.
-
– mappingOperation:didSetValue:forKeyPath:usingMapping:Tells the delegate that the mapping operation has set a value for a given key path with an attribute or relationship mapping.
-
– mappingOperation:didNotSetUnchangedValue:forKeyPath:usingMapping:Tells the delegate that the mapping operation has declined to set a value for a given key path because the value has not changed.
-
– mappingOperation:didFailWithError:Tells the delegate that the mapping operation has failed due to an error.
Tracking Dynamic Mapping Selection
-
– mappingOperation:didSelectObjectMapping:forDynamicMapping:Tells the delegate that the mapping operation has selected a concrete object mapping with which to map the source object.
Tracking Relationship Connections
-
– mappingOperation:didConnectRelationship:toValue:usingConnection:Tells the delegate that the mapping operation has connected a relationship.
-
– mappingOperation:didFailToConnectRelationship:usingConnection:Tells the delegate that the mapping operation failed to connect a relationship.
Instance Methods
mappingOperation:didConnectRelationship:toValue:usingConnection:
Tells the delegate that the mapping operation has connected a relationship.
- (void)mappingOperation:(RKMappingOperation *)operation didConnectRelationship:(NSRelationshipDescription *)relationship toValue:(id)value usingConnection:(RKConnectionDescription *)connectionParameters
- operation
The mapping operation.
- relationship
The relationship that was connected.
- value
The value that was connected to the relationship
- connection
The connection object describing how the relationship was to be connected.
Discussion
Only sent when mapping an RKEntityMapping object that contains connection mappings.
Declared In
RKMappingOperation.hmappingOperation:didFailToConnectRelationship:usingConnection:
Tells the delegate that the mapping operation failed to connect a relationship.
- (void)mappingOperation:(RKMappingOperation *)operation didFailToConnectRelationship:(NSRelationshipDescription *)relationship usingConnection:(RKConnectionDescription *)connectionParameters
- operation
The mapping operation.
- relationship
The relationship that was connected.
- connection
The connection object describing how the relationship was to be connected.
Discussion
Only sent when mapping an RKEntityMapping object that contains connection mappings.
Declared In
RKMappingOperation.hmappingOperation:didFailWithError:
Tells the delegate that the mapping operation has failed due to an error.
- (void)mappingOperation:(RKMappingOperation *)operation didFailWithError:(NSError *)errorParameters
- operation
The object mapping operation that has failed.
- error
An error object indicating the reason for the failure.
Declared In
RKMappingOperation.hmappingOperation:didFindValue:forKeyPath:mapping:
Tells the delegate that an attribute or relationship mapping was found for a given key path within the data being mapped.
- (void)mappingOperation:(RKMappingOperation *)operation didFindValue:(id)value forKeyPath:(NSString *)keyPath mapping:(RKPropertyMapping *)propertyMappingParameters
- operation
The object mapping operation being performed.
- value
The value that was found at the given key path in the source object representation.
- keyPath
The key path in the source object for which the mapping is to be applied.
- propertyMapping
The
RKAttributeMappingorRKRelationshipMappingfor which the mappable value was found within the source object representation.
Declared In
RKMappingOperation.hmappingOperation:didNotFindValueForKeyPath:mapping:
Tells the delegate that no attribute or relationships mapping was found for a given key path within the data being mapped.
- (void)mappingOperation:(RKMappingOperation *)operation didNotFindValueForKeyPath:(NSString *)keyPath mapping:(RKPropertyMapping *)propertyMappingParameters
- operation
The object mapping operation being performed.
- keyPath
The key path in the source object for which no mappable value was found.
- propertyMapping
The
RKAttributeMappingorRKRelationshipMappingfor which no mappable value could be found within the source object representation.
Declared In
RKMappingOperation.hmappingOperation:didNotSetUnchangedValue:forKeyPath:usingMapping:
Tells the delegate that the mapping operation has declined to set a value for a given key path because the value has not changed.
- (void)mappingOperation:(RKMappingOperation *)operation didNotSetUnchangedValue:(id)value forKeyPath:(NSString *)keyPath usingMapping:(RKPropertyMapping *)propertyMappingParameters
- operation
The object mapping operation being performed.
- value
A unchanged value for the key path in the destination object.
- keyPath
The key path in the destination object for which a unchanged value was not set.
- propertyMapping
The
RKAttributeMappingorRKRelationshipMappingfound for the key path.
Declared In
RKMappingOperation.hmappingOperation:didSelectObjectMapping:forDynamicMapping:
Tells the delegate that the mapping operation has selected a concrete object mapping with which to map the source object.
- (void)mappingOperation:(RKMappingOperation *)operation didSelectObjectMapping:(RKObjectMapping *)objectMapping forDynamicMapping:(RKDynamicMapping *)dynamicMappingParameters
- operation
The mapping operation.
- objectMapping
The concrete object mapping with which to perform the mapping.
- dynamicMapping
The dynamic source mapping from which the object mapping was determined.
Discussion
Only sent if the receiver was initialized with an instance of RKDynamicMapping as the mapping.
Declared In
RKMappingOperation.hmappingOperation:didSetValue:forKeyPath:usingMapping:
Tells the delegate that the mapping operation has set a value for a given key path with an attribute or relationship mapping.
- (void)mappingOperation:(RKMappingOperation *)operation didSetValue:(id)value forKeyPath:(NSString *)keyPath usingMapping:(RKPropertyMapping *)propertyMappingParameters
- operation
The object mapping operation being performed.
- value
A new value that was set on the destination object.
- keyPath
The key path in the destination object for which a new value has been set.
- propertyMapping
The
RKAttributeMappingorRKRelationshipMappingfound for the key path.
Declared In
RKMappingOperation.hmappingOperation:shouldSetValue:forKeyPath:usingMapping:
Asks the delegate if the mapping operation should set a value for a given key path with an attribute or relationship mapping. This method is invoked before the value is set. If the delegate does not implement this method, then the mapping operation will determine if the value should be set by comparing the current property value with the new property value.
- (BOOL)mappingOperation:(RKMappingOperation *)operation shouldSetValue:(id)value forKeyPath:(NSString *)keyPath usingMapping:(RKPropertyMapping *)propertyMappingParameters
- operation
The object mapping operation being performed.
- value
A new value that was set on the destination object.
- keyPath
The key path in the destination object for which a new value has been set.
- propertyMapping
The
RKAttributeMappingorRKRelationshipMappingfound for the key path.
Return Value
YES if the operation should set the proposed value for the key path, else NO.
Declared In
RKMappingOperation.h