我有一個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;
}];
}
它不給我任何錯誤,當我運行它,但它根本不顯示..任何建議?