CocoaDocs.org - RKMappingOperationDataSource Protocol ReferencecommitChangesForMappingOperation:error:mappingOperation:deleteExistingValueOfRelationshipWithMapping:error:mappingOperation:targetObjectForMapping:inRelationship:mappingOperation:targetObjectForRepresentation:withMapping:inRelationship:mappingOperationShouldCollectMappingInfo:mappingOperationShouldSetUnchangedValues:mappingOperationShouldSkipPropertyMapping:Jump To Overview Tasks Instance Methods - commitChangesForMappingOperation:error: - mappingOperation:deleteExistingValueOfRelationshipWithMapping:error: - mappingOperation:targetObjectForMapping:inRelationship: - mappingOperation:targetObjectForRepresentation:withMapping:inRelationship: - mappingOperationShouldCollectMappingInfo: - mappingOperationShouldSetUnchangedValues: - mappingOperationShouldSkipPropertyMapping:RKMappingOperationDataSource Protocol ReferenceDeclared in RKMappingOperationDataSource.hAn object that adopts the RKMappingOperationDataSource protocol is responsible for the retrieval or creation of target objects within an RKMapperOperation or RKMappingOperation. A data source is responsible for meeting the requirements of the underlying data store implementation and must return a key-value coding compliant object instance that can be used as the target object of a mapping operation. It is also responsible for commiting any changes necessary to the underlying data store once a mapping operation has completed its work.At a minimum, a data source must implement the mappingOperation:targetObjectForRepresentation:withMapping: method. This method is responsible for finding an existing object instance to be updated or creating a new object if no existing object could be found or the underlying data store does not support persistence. Object mapping operations which target NSObject derived classes will always result in mapping to new transient objects, while persistent data stores such as Core Data can be queried to retrieve existing objects for update.– mappingOperation:targetObjectForRepresentation:withMapping:inRelationship:Asks the data source for the target object for an object mapping operation given an NSDictionary representation of the object’s properties and the mapping object that will be used to perform the mapping.– mappingOperation:targetObjectForMapping:inRelationship:Asks the data source for the target object for an object mapping operation the mapping object that will be used to perform the mapping.– commitChangesForMappingOperation:error:Tells the data source to commit any changes to the underlying data store.– mappingOperation:deleteExistingValueOfRelationshipWithMapping:error:Tells the data source to delete the existing value for a relationship that has been mapped with an assignment policy of RKReplaceAssignmentPolicy.– mappingOperationShouldSetUnchangedValues:Asks the data source if it should set values for properties without checking that the value has been changed. This method can result in a performance improvement during mapping as the mapping operation will not attempt to assess the change state of the property being mapped.– mappingOperationShouldSkipPropertyMapping:– mappingOperationShouldCollectMappingInfo:Asks the data source if the mapping operation should collect RKMappingInfo information during the mapping (stored in the mappingInfo property). If not needed, it can be a substantially faster to skip it. The mappingInfo property will be nil if not collected.The mapping operation that has completed its work.A pointer to an error to be set in the event that the mapping operation could not be committed.A Boolean value indicating if the changes for the mapping operation were committed successfully.RKMappingOperationDataSource.h- (BOOL)mappingOperation:(RKMappingOperation *)mappingOperation deleteExistingValueOfRelationshipWithMapping:(RKRelationshipMapping *)relationshipMapping error:(NSError **)errorThe mapping operation that is executing.The relationship mapping for which the existing value is being replaced.A pointer to an error to be set in the event that the deletion operation could not be completed.A Boolean value indicating if the existing objects for the relationship were successfully deleted.- (id)mappingOperation:(RKMappingOperation *)mappingOperation targetObjectForMapping:(RKObjectMapping *)mapping inRelationship:(RKRelationshipMapping *)relationshipMappingIf not implemented or it returns nil, then the mappingOperation:targetObjectForRepresentation:withMapping:inRelationship: method will be called to determine the target.It is preferable to implement this method if the representation is not needed to determine the target object, as obtaining that value is somewhat expensive.The mapping operation requesting the target object.The object mapping to be used to perform a mapping from the representation to the target object.A dictionary representation of the properties to be mapped onto the retrieved target object.A key-value coding compliant object to perform the mapping on to.- (id)mappingOperation:(RKMappingOperation *)mappingOperation targetObjectForRepresentation:(NSDictionary *)representation withMapping:(RKObjectMapping *)mapping inRelationship:(RKRelationshipMapping *)relationshipMappingThe representation value is a fragment of content from a deserialized response that has been identified as containing content that is mappable using the given mapping.- (BOOL)mappingOperationShouldCollectMappingInfo:(RKMappingOperation *)mappingOperationIf this method is not implemented by the data source, then the mapping operation defaults to YES.The mapping operation that is querying the data source.YES if the mapping operation should collect mapping information, else NO.- (BOOL)mappingOperationShouldSetUnchangedValues:(RKMappingOperation *)mappingOperationIf this method is not implemented by the data source, then the mapping operation defaults to NO.YES if the mapping operation should disregard property change status, else NO.- (BOOL)mappingOperationShouldSkipPropertyMapping:(RKMappingOperation *)mappingOperation
