[英]can't initiate nested block on iOS8
我正在尝试在另一个块内执行嵌套块。 与以前的iOS版本相比,iOS8上的异步请求似乎超时很快。 这是我的解析代码:
- (void)getRemoteImageAndSaveLocalWithObjectId:(NSString *)objectId andType:(NSString *)type{
if ([type isEqualToString:@"user"]) {
PFQuery *query = [GAUser query];
//[query includeKey:@"userImage"];
[query getObjectInBackgroundWithId:objectId block:^(PFObject *object, NSError *error) {
GAUser *gaUser = (GAUser *)object;
PFFile *userImageFile = gaUser[@"@userImage"];
[userImageFile getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
// I am never able to get inside this block of code.
NSLog(@"in get data");
if (!error) {
NSLog(@"remote image name: %@",data.debugDescription);
UIImage *image = [UIImage imageWithData:data];
}else{
NSLog(@"there was an error");
}
}];
}];
}
}
有谁知道为什么我不能进入getDataInBackgroundWithBlock
块?
达伦和安迪是对的(他们可能是兄弟)。
userImageFile为零,这就是问题所在。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.