正如您在屏幕截图中看到的那样,我想从解析加载图像。
我正在使用此代码将标题图像加载到我的 imageview 中。
PFQuery *query = [PFQuery queryWithClassName:@"AppOfTheDay"];
[query getObjectInBackgroundWithId:@"WDJpxs4PzH"
block:^(PFObject *retreive, NSError *error) {
{
NSString *text = [retreive objectForKey:@"description"];
if (error) {
[MBProgressHUD hideHUDForView:self.view animated:YES];
UIAlertView *error=[[UIAlertView alloc]initWithTitle:@"Error" message:@"Connection Failed" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[error show];
}
else{
PFFile *imageFile = [retreive objectForKey:@"header"];
[imageFile getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
if (error) {
[MBProgressHUD hideHUDForView:self.view animated:YES];
UIAlertView *error=[[UIAlertView alloc]initWithTitle:@"Error" message:@"Something went wrong" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[error show];
}
else{
UIImage *image = [UIImage imageWithData:data];
_headerImage.image=image;
_appDescription.text=text;
[MBProgressHUD hideHUDForView:self.view animated:YES];
}
}];
}
}
}];
我的问题是我怎样才能将其他三个图像类似地加载到图像视图中?