我有一个mapview,显示从解析中拉出的注释数组。每个人都有一个详细的视图控制器,显示连接到注释的标签,我想要显示图像,但似乎无法弄清楚。这是我目前的代码通过解析显示图像iOS
- (void)viewDidLoad
{
[super viewDidLoad];
PFObject *gameScore = [PFObject objectWithClassName:@"Arcade"];
self.title = @"Detail View";
PFQuery *query = [PFQuery queryWithClassName:@"Arcade"];
NSString *objectId = gameScore.objectId;
[query getObjectInBackgroundWithId:ObjectIdentifier block:^(PFObject *gameScore, NSError *error) {
lblTitle.text = pawpost.title;
lblPhone.text = pawpost.phone;
lblAddress.text = pawpost.address;
__block UIImage *MyPicture = [[UIImage alloc]init];
PFFile *imageFile = [gameScore objectForKey:@"image"];
[imageFile getDataInBackgroundWithBlock:^(NSData *data, NSError *error){
if (!error) {
MyPicture = [UIImage imageWithData:data];
}
}];
imgView.image = MyPicture;
}];
}
它不给我任何错误,当我运行它,但它根本不显示..任何建议?