mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-19 23:50:11 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user