Initialize RKPaginator with an operation queue. This avoids deadlocks when working with RKManagedObjectRequestOperation instances bound to the main thread. This is a workaround to deal with object request operations being non-concurrent and executing in the calling thread context. refs #1076

This commit is contained in:
Blake Watters
2012-12-21 14:11:05 -05:00
parent 0fc1cbe271
commit 913b8a1b9e

View File

@@ -71,6 +71,7 @@ static NSUInteger RKPaginatorDefaultPerPage = 25;
self.objectCount = NSNotFound;
self.perPage = RKPaginatorDefaultPerPage;
self.loaded = NO;
self.operationQueue = [NSOperationQueue new];
}
return self;
@@ -208,11 +209,7 @@ static NSUInteger RKPaginatorDefaultPerPage = 25;
}
}];
if (self.operationQueue) {
[self.operationQueue addOperation:self.objectRequestOperation];
} else {
[self.objectRequestOperation start];
}
[self.operationQueue addOperation:self.objectRequestOperation];
}
- (void)waitUntilFinished