Allow RKRequests (and object loaders) to be 'reset' so that you can send them again.

Reset RKObjectLoaders before sending them in RKObjectLoaderTTModel. This fixes reloading of the model (i.e. pull to refresh).
This commit is contained in:
Jeremy Ellison
2011-06-16 13:45:14 -04:00
parent e3a007fcf7
commit 9388673d67
3 changed files with 25 additions and 6 deletions

View File

@@ -202,7 +202,10 @@ static NSString* const kDefaultLoadedTimeKey = @"RKRequestTTModelDefaultLoadedTi
if (store.managedObjectCache) {
cacheFetchRequests = [store.managedObjectCache fetchRequestsForResourcePath:self.resourcePath];
}
// Reset in case we are reusing the object loader (model was reloaded).
[self.objectLoader reset];
if (!store.managedObjectCache || !cacheFetchRequests || _cacheLoaded) {
_isLoading = YES;
[self didStartLoad];