RKRequestTTModel Class Reference
Inherits from | TTModel |
Conforms to | RKObjectLoaderDelegate |
Declared in | RKRequestTTModel.h RKRequestTTModel.m |
Overview
Generic class for loading a remote model using a RestKit request and supplying the model to a TTListDataSource subclass
Tasks
Other Methods
-
objects
Domain objects loaded via this model
property -
resourcePath
The resourcePath used to create this model
property -
loadedTime
The NSDate object representing the last time this model was loaded.
property -
params
Request parameters
property -
method
The HTTP method to load the models with. Defaults to RKRequestMethodGET
property -
refreshRate
The rate at which this model should be refreshed after initial load. Defaults to the value returned by + (NSTimeInterval)defaultRefreshRate.
property -
– initWithResourcePath:
Init methods for creating new models
-
+ defaultLoadedTime
The NSDate representing the first time the app was run. This defaultLoadedTime is used in comparison with refreshRate in cases where a resourcePath-specific loadedTime has yet to be established for a given resourcePath.
-
+ defaultRefreshRate
App-level default refreshRate used in determining when to refresh a given model. Defaults to NSTimeIntervalSince1970, which essentially means all app models will never refresh.
-
+ setDefaultRefreshRate:
Setter for defaultRefreshRate, which allows one to set an app-wide refreshRate for all models, as opposed to having to set the refreshRate on every instantiation of RKRequestTTModel.
Other Methods
-
– objectLoader:didLoadObjects:
Sent when an object loader has completed successfully and loaded a collection of mapped objects
Other Methods
-
– objectLoader:didFailWithError:
Sent when an object loaded failed to load the collection due to an error
Other Methods
-
– objectLoaderDidLoadUnexpectedResponse:
Sent when an object loader encounters a response status code it does not know how to handle. 2xx, 4xx, and 5xx responses are all handled appropriately. This should only occur when the remote service sends back a really odd-ball response.
Properties
loadedTime
The NSDate object representing the last time this model was loaded.
@property (nonatomic, readonly) NSDate *loadedTime
Declared In
RKRequestTTModel.h
objects
Domain objects loaded via this model
@property (nonatomic, readonly) NSArray *objects
Declared In
RKRequestTTModel.h
params
Request parameters
@property (nonatomic, retain) NSDictionary *params
Declared In
RKRequestTTModel.h
refreshRate
The rate at which this model should be refreshed after initial load. Defaults to the value returned by + (NSTimeInterval)defaultRefreshRate.
@property (assign) NSTimeInterval refreshRate
Declared In
RKRequestTTModel.h
resourcePath
The resourcePath used to create this model
@property (nonatomic, readonly) NSString *resourcePath
Declared In
RKRequestTTModel.h
Class Methods
defaultLoadedTime
The NSDate representing the first time the app was run. This defaultLoadedTime is used in comparison with refreshRate in cases where a resourcePath-specific loadedTime has yet to be established for a given resourcePath.
+ (NSDate *)defaultLoadedTime
Declared In
RKRequestTTModel.h
defaultRefreshRate
App-level default refreshRate used in determining when to refresh a given model. Defaults to NSTimeIntervalSince1970, which essentially means all app models will never refresh.
+ (NSTimeInterval)defaultRefreshRate
Declared In
RKRequestTTModel.h
setDefaultRefreshRate:
Setter for defaultRefreshRate, which allows one to set an app-wide refreshRate for all models, as opposed to having to set the refreshRate on every instantiation of RKRequestTTModel.
+ (void)setDefaultRefreshRate:(NSTimeInterval)newDefaultRefreshRate
Declared In
RKRequestTTModel.h
Instance Methods
initWithResourcePath:
Init methods for creating new models
- (id)initWithResourcePath:(NSString *)resourcePath
Declared In
RKRequestTTModel.h
objectLoader:didFailWithError:
Sent when an object loaded failed to load the collection due to an error
- (void)objectLoader:(RKObjectLoader *)objectLoader didFailWithError:(NSError *)error
Declared In
RKObjectLoader.h
objectLoader:didLoadObjects:
Sent when an object loader has completed successfully and loaded a collection of mapped objects
- (void)objectLoader:(RKObjectLoader *)objectLoader didLoadObjects:(NSArray *)objects
Declared In
RKObjectLoader.h
objectLoaderDidLoadUnexpectedResponse:
Sent when an object loader encounters a response status code it does not know how to handle. 2xx, 4xx, and 5xx responses are all handled appropriately. This should only occur when the remote service sends back a really odd-ball response.
- (void)objectLoaderDidLoadUnexpectedResponse:(RKObjectLoader *)objectLoader
Discussion
@optional
Declared In
RKObjectLoader.h