I am using RestKit version 0.2, and I see that it blocks the user interface (this means the user interface is becoming mutable / not responding) when I call RKRequestOperation as follows:
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset { NSString *urlString = [NSString stringWithFormat:@"http://localhost:8080/models?offset=%d&rows=%d", _offset, _numRows]; NSURL *url = [NSURL URLWithString:urlString]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; RKObjectRequestOperation *operation = [[RKObjectRequestOperation alloc] initWithRequest:request responseDescriptors:@[_responseDescriptor]]; [operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation *operation, RKMappingResult *result) { NSLog(@"Got models: %@", [result array]); [self addModelsToView:[results array]]; } failure:^(RKObjectRequestOperation *operation, NSError *error) { NSLog(@"FAILED!"); }]; [operation start]; }
A bit more background:
I do this to load new model views into an infinite UIScrollView . I detect when the user scrolls to the bottom of the view (coordinate logic corrected), use RestKit, as indicated above, to load the next set of views, and when the models return, I load them into the scroll in addModelsToView . Even when I comment on addModelsToView , the volatile logic remains, so I'm sure this has something to do with RestKit (or how I use it, at least).
From what I understand about RestKit, it is that it loads asynchronously, so it's hard for me to find out why / where the volatility is happening.
Thanks in advance!
source share