Inherits from NSObject
Conforms to RKMappingOperationDataSource
Declared in RKManagedObjectMappingOperationDataSource.h

Overview

The RKManagedObjectMappingOperationDataSource class provides support for performing object mapping operations where the mapped objects exist within a Core Data managed object context. The class is responsible for finding exist managed object instances by the identification attributes, instantiating new managed objects, and connecting relationships for mapped objects.

Tasks

Initializing a Managed Object Mapping Operation Data Source

Accessing the Managed Object Context and Cache

  •   managedObjectContext

    The managed object context with which the receiver is associated.

    property
  •   managedObjectCache

    The managed object cache utilized by the receiver to find existing managed object instances by the identification attributes. A nil managed object cache will result in the insertion of new managed objects for all mapped content.

    property

Configuring Relationship Connection Queueing

Properties

managedObjectCache

The managed object cache utilized by the receiver to find existing managed object instances by the identification attributes. A nil managed object cache will result in the insertion of new managed objects for all mapped content.

@property (nonatomic, strong, readonly) id<RKManagedObjectCaching> managedObjectCache

Declared In

RKManagedObjectMappingOperationDataSource.h

managedObjectContext

The managed object context with which the receiver is associated.

@property (nonatomic, strong, readonly) NSManagedObjectContext *managedObjectContext

Declared In

RKManagedObjectMappingOperationDataSource.h

operationQueue

The operation queue in which instances of RKRelationshipConnectionOperation will be enqueued to connect the relationships of mapped objects.

@property (nonatomic, strong) NSOperationQueue *operationQueue

Discussion

If nil, then current operation queue as returned from [NSOperationQueue currentQueue] will be used.

Please see the documentation for parentOperation for a discussion of this property’s function.

Declared In

RKManagedObjectMappingOperationDataSource.h

parentOperation

The parent operation upon which instances of RKRelationshipConnectionOperation created by the data source are dependent upon.

@property (nonatomic, weak) NSOperation *parentOperation

Discussion

When connecting relationships as part of a managed object mapping operation, it is possible that the mapping operation itself will create managed objects that should be used to satisfy the connections mappings of representations being mapped. To support such cases, is is desirable to defer the execution of connection operations until the execution of the aggregate mapping operation is complete. The parentOperation property provides support for deferring the execution of the enqueued relationship connection operations by establishing a dependency between the connection operations and a parent operation, such as an instance of RKMapperOperation such that they will not be executed by the operationQueue until the parent operation has finished executing.

Declared In

RKManagedObjectMappingOperationDataSource.h

Instance Methods

initWithManagedObjectContext:cache:

Initializes the receiver with a given managed object context and managed object cache.

- (id)initWithManagedObjectContext:(NSManagedObjectContext *)managedObjectContext cache:(id<RKManagedObjectCaching>)managedObjectCache

Parameters

managedObjectContext

The managed object context with which to associate the receiver. Cannot be nil.

managedObjectCache

The managed object cache used by the receiver to find existing object instances by their identification attributes.

Return Value

The receiver, initialized with the given managed object context and managed objet cache.

Declared In

RKManagedObjectMappingOperationDataSource.h