【发布时间】:2015-03-23 15:58:07
【问题描述】:
我试图在另一个调度块中调用下面的解析检索方法,但它从不调用。我怀疑在另一个块中调用一个块是不允许的,但不确定。有人知道为什么不调用 findObjectsInBackgroundWithBlock 吗?
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
PFQuery *query = [PFQuery queryWithClassName:@"quotes"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
NSMutableArray *tempQuotes = [[NSMutableArray alloc] init];
for (PFObject *object in objects) {
[tempQuotes addObject:[object objectForKey:@"quote"]];
}
quotes = tempQuotes;
}
}];
dispatch_async(dispatch_get_main_queue(), ^{
[self.delegate postRefreshing];
});
});
【问题讨论】:
标签: ios objective-c parse-platform dispatch