我不知道解析是什么,但由于某种原因,它不允许我将检索到的数组保存到我创建的可变数组中。它在解析代码块内工作,但一旦在外面,它就会显示空值。请帮忙?
PFQuery *query = [PFQuery queryWithClassName:@"comments"];
[query whereKey:@"flirtID" equalTo:recipe.flirtID];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
comments = [[NSMutableArray alloc]initWithArray:objects];
// Do something with the found objects
for (PFObject *object in objects) {
}
} else {
// Log details of the failure
NSLog(@"Error: %@ %@", error, [error userInfo]);
}
}];
NSLog(@"%@",[comments objectAtIndex:0]);