RKObjectLoader Class Reference
| Inherits from | RKRequest : NSObject |
| Declared in | RKObjectLoader.h RKObjectLoader.m |
Overview
Wraps a request/response cycle and loads a remote object representation into local domain objects
NOTE: When Core Data is linked into the application, the object manager will return instances of RKManagedObjectLoader instead of RKObjectLoader. RKManagedObjectLoader is a descendent class that includes Core Data specific mapping logic.
Tasks
Other Methods
-
delegateThe object that acts as the delegate of the receiving object loader.
property -
onDidFailWithErrorThe block to invoke when the object loader fails due to an error.
property -
onDidLoadObjectThe block to invoke when the object loader has completed object mapping and the consumer wishes to retrieve a single object from the mapping result.
property -
onDidLoadObjectsThe block to invoke when the object loader has completed object mapping and the consumer wishes to retrieve an collections of objects from the mapping result.
property -
onDidLoadObjectsDictionaryThe block to invoke when the object loader has completed object mapping and the consumer wishes to retrieve the entire mapping result as a dictionary. Each key within the dictionary will correspond to a mapped keyPath within the source JSON/XML and the value will be the object mapped result.
property -
objectMappingThe object mapping to use when processing the response. If this is nil, then RestKit will search the parsed response body for mappable keyPaths and perform mapping on all available content. For instances where your target JSON is not returned under a uniquely identifiable keyPath, you must specify the object mapping directly for RestKit to know how to map it.
property -
mappingProviderA mapping provider containing object mapping configurations for mapping remote object representations into local domain objects.
property -
responseThe underlying response object for this loader
property -
resultThe mapping result that was produced after the request finished loading and object mapping has completed. Provides access to the final products of the object mapper in a variety of formats.
property -
serializationMappingThe object mapping to use when serializing a target object for transport to the remote server.
property -
serializationMIMETypeThe MIME Type to serialize the targetObject into according to the mapping rules in the serializationMapping. Typical MIME Types for serialization are JSON (RKMIMETypeJSON) and URL Form Encoded (RKMIMETypeFormURLEncoded).
property -
sourceObjectThe object being serialized for transport. This object will be transformed into a serialization in the serializationMIMEType using the serializationMapping.
property -
targetObjectThe target object to map results back onto. If nil, a new object instance for the appropriate mapping will be created. If not nil, the results will be used to update the targetObject’s attributes and relationships.
property -
mappingQueueThe Grand Central Dispatch queue to perform our parsing and object mapping within. By default, object loaders will use the mappingQueue from the RKObjectManager that created the loader. You can override this on a per-loader basis as necessary.
property -
+ loaderWithURL:mappingProvider:Initialize and return an autoreleased object loader targeting a remote URL using a mapping provider
-
– initWithURL:mappingProvider:Initialize and return an autoreleased object loader targeting a remote URL using a mapping provider
-
– handleResponseErrorHandle an error in the response preventing it from being mapped, called from isResponseMappable
Other Methods
-
– reset -
– processMappingResult:Overloaded by RKManagedObjectLoader to serialize/deserialize managed objects at thread boundaries. @protected
-
– prepareURLRequest -
– didFailLoadWithError:Callback performed to notify the request that the underlying NSURLConnection has failed with an error.
-
– didFinishLoad:Callback performed to notify the request that the underlying NSURLConnection has completed with a response.
Extension Methods
Properties
delegate
The object that acts as the delegate of the receiving object loader.
@property (nonatomic, assign) id<> delegateSee Also
Declared In
RKObjectLoader.hloaded
Returns YES when this request has been completed
@property (nonatomic, assign, readwrite, getter=isLoaded) BOOL loadedDeclared In
RKRequest.hloading
Returns YES when this request is in-progress
@property (nonatomic, assign, readwrite, getter=isLoading) BOOL loadingDeclared In
RKRequest.hmappingProvider
A mapping provider containing object mapping configurations for mapping remote object representations into local domain objects.
@property (nonatomic, retain) RKObjectMappingProvider *mappingProviderSee Also
Declared In
RKObjectLoader.hmappingQueue
The Grand Central Dispatch queue to perform our parsing and object mapping within. By default, object loaders will use the mappingQueue from the RKObjectManager that created the loader. You can override this on a per-loader basis as necessary.
@property (nonatomic, assign) dispatch_queue_t mappingQueueDeclared In
RKObjectLoader.hobjectMapping
The object mapping to use when processing the response. If this is nil, then RestKit will search the parsed response body for mappable keyPaths and perform mapping on all available content. For instances where your target JSON is not returned under a uniquely identifiable keyPath, you must specify the object mapping directly for RestKit to know how to map it.
@property (nonatomic, retain) RKObjectMapping *objectMappingDiscussion
@default nil
See Also
Declared In
RKObjectLoader.honDidFailWithError
The block to invoke when the object loader fails due to an error.
@property (nonatomic, copy) RKObjectLoaderDidFailWithErrorBlock onDidFailWithErrorDeclared In
RKObjectLoader.honDidLoadObject
The block to invoke when the object loader has completed object mapping and the consumer wishes to retrieve a single object from the mapping result.
@property (nonatomic, copy) RKObjectLoaderDidLoadObjectBlock onDidLoadObjectDeclared In
RKObjectLoader.honDidLoadObjects
The block to invoke when the object loader has completed object mapping and the consumer wishes to retrieve an collections of objects from the mapping result.
@property (nonatomic, copy) RKObjectLoaderDidLoadObjectsBlock onDidLoadObjectsDeclared In
RKObjectLoader.honDidLoadObjectsDictionary
The block to invoke when the object loader has completed object mapping and the consumer wishes to retrieve the entire mapping result as a dictionary. Each key within the dictionary will correspond to a mapped keyPath within the source JSON/XML and the value will be the object mapped result.
@property (nonatomic, copy) RKObjectLoaderDidLoadObjectsDictionaryBlock onDidLoadObjectsDictionaryDeclared In
RKObjectLoader.hresponse
The underlying response object for this loader
@property (nonatomic, retain, readonly) RKResponse *responseDeclared In
RKObjectLoader.hresult
The mapping result that was produced after the request finished loading and object mapping has completed. Provides access to the final products of the object mapper in a variety of formats.
@property (nonatomic, readonly) RKObjectMappingResult *resultDeclared In
RKObjectLoader.hserializationMIMEType
The MIME Type to serialize the targetObject into according to the mapping rules in the serializationMapping. Typical MIME Types for serialization are JSON (RKMIMETypeJSON) and URL Form Encoded (RKMIMETypeFormURLEncoded).
@property (nonatomic, retain) NSString *serializationMIMETypeDeclared In
RKObjectLoader.hserializationMapping
The object mapping to use when serializing a target object for transport to the remote server.
@property (nonatomic, retain) RKObjectMapping *serializationMappingSee Also
Declared In
RKObjectLoader.hsourceObject
The object being serialized for transport. This object will be transformed into a serialization in the serializationMIMEType using the serializationMapping.
@property (nonatomic, retain) NSObject *sourceObjectSee Also
Declared In
RKObjectLoader.htargetObject
The target object to map results back onto. If nil, a new object instance for the appropriate mapping will be created. If not nil, the results will be used to update the targetObject’s attributes and relationships.
@property (nonatomic, retain) NSObject *targetObjectDeclared In
RKObjectLoader.hClass Methods
loaderWithURL:mappingProvider:
Initialize and return an autoreleased object loader targeting a remote URL using a mapping provider
+ (id)loaderWithURL:(RKURL *)URL mappingProvider:(RKObjectMappingProvider *)mappingProviderParameters
- URL
A RestKit RKURL targetting a particular baseURL and resourcePath
- mappingProvider
A mapping provider containing object mapping configurations for processing loaded payloads
Declared In
RKObjectLoader.hInstance Methods
didFailLoadWithError:
Callback performed to notify the request that the underlying NSURLConnection has failed with an error.
- (void)didFailLoadWithError:(NSError *)errorParameters
- error
An NSError object containing the RKRestKitError that triggered the callback.
Declared In
RKRequest.hdidFinishLoad:
Callback performed to notify the request that the underlying NSURLConnection has completed with a response.
- (void)didFinishLoad:(RKResponse *)responseParameters
- response
An RKResponse object with the result of the request.
Declared In
RKRequest.hhandleResponseError
Handle an error in the response preventing it from being mapped, called from isResponseMappable
- (void)handleResponseErrorDeclared In
RKObjectLoader.hinitWithURL:mappingProvider:
Initialize and return an autoreleased object loader targeting a remote URL using a mapping provider
- (id)initWithURL:(RKURL *)URL mappingProvider:(RKObjectMappingProvider *)mappingProviderParameters
- URL
A RestKit RKURL targetting a particular baseURL and resourcePath
- mappingProvider
A mapping provider containing object mapping configurations for processing loaded payloads
Declared In
RKObjectLoader.hprocessMappingResult:
Overloaded by RKManagedObjectLoader to serialize/deserialize managed objects at thread boundaries. @protected
- (void)processMappingResult:(RKObjectMappingResult *)resultDeclared In
RKObjectLoader.m