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
-
objectManager
The object manager that initialized this loader. The object manager is responsible for supplying the mapper and object store used after HTTP transport is completed
property -
response
The underlying response object for this loader
property -
objectClass
The mappable object class to load payload results into. When nil, indicates that the resulting objects will be determined via element registrations on the mapper.
property -
targetObject
The mappable object that generated this loader. This is used to map object updates back to the object that sent the request
property -
+ loaderWithResourcePath:objectManager:delegate:
Initialize and return an object loader for a resource path against an object manager. The resource path specifies the remote location to load data from, while the object manager is responsible for supplying mapping and persistence details.
-
– initWithResourcePath:objectManager:delegate:
Initialize a new object loader with an object mapper, a request, and a delegate
Other Methods
-
– handleTargetObject
If this loader is bound to a particular object, then we map the results back into the instance. This is used for loading and updating individual object instances via getObject and friends.
Other Methods
-
– prepareURLRequest
Setup the NSURLRequest. The request must be prepared right before dispatching
Other Methods
-
– didFailLoadWithError:
Callback performed to notify the request that the underlying NSURLConnection has failed with an error.
Other Methods
-
– didFinishLoad:
Callback performed to notify the request that the underlying NSURLConnection has completed with a response.
Properties
objectClass
The mappable object class to load payload results into. When nil, indicates that the resulting objects will be determined via element registrations on the mapper.
@property (nonatomic, assign) Class<RKObjectMappable> objectClass
Declared In
RKObjectLoader.h
objectManager
The object manager that initialized this loader. The object manager is responsible for supplying the mapper and object store used after HTTP transport is completed
@property (nonatomic, readonly) RKObjectManager *objectManager
Declared In
RKObjectLoader.h
response
The underlying response object for this loader
@property (nonatomic, readonly) RKResponse *response
Declared In
RKObjectLoader.h
Class Methods
loaderWithResourcePath:objectManager:delegate:
Initialize and return an object loader for a resource path against an object manager. The resource path specifies the remote location to load data from, while the object manager is responsible for supplying mapping and persistence details.
+ (id)loaderWithResourcePath:(NSString *)resourcePath objectManager:(RKObjectManager *)objectManager delegate:(NSObject<RKObjectLoaderDelegate> *)delegate
Declared In
RKObjectLoader.h
Instance Methods
didFailLoadWithError:
Callback performed to notify the request that the underlying NSURLConnection has failed with an error.
- (void)didFailLoadWithError:(NSError *)error
Declared In
RKRequest.h
didFinishLoad:
Callback performed to notify the request that the underlying NSURLConnection has completed with a response.
- (void)didFinishLoad:(RKResponse *)response
Declared In
RKRequest.h
handleTargetObject
If this loader is bound to a particular object, then we map the results back into the instance. This is used for loading and updating individual object instances via getObject and friends.
- (void)handleTargetObject
Declared In
RKManagedObjectLoader.m
initWithResourcePath:objectManager:delegate:
Initialize a new object loader with an object mapper, a request, and a delegate
- (id)initWithResourcePath:(NSString *)resourcePath objectManager:(RKObjectManager *)objectManager delegate:(NSObject<RKObjectLoaderDelegate> *)delegate
Declared In
RKObjectLoader.h
prepareURLRequest
Setup the NSURLRequest. The request must be prepared right before dispatching
- (void)prepareURLRequest
Declared In
RKRequest.h