我正在使用集合视图控制器来显示缩略图。单击缩略图,segue 会以模态方式打开完整图像。它在模拟器上运行良好,但在我的 iphone 或 ipad 上运行良好。完整的图像是空白的。“评论”显示在所有设备中。
这是转场:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"showBandPhoto"]) {
NSArray *indexPaths = [self.collectionView indexPathsForSelectedItems];
BDBPhotoViewController *destViewController = segue.destinationViewController;
NSIndexPath *indexPath = [indexPaths objectAtIndex:0];
PFObject *tempObject = [imageObjectsArray objectAtIndex:indexPath.row];
PFFile *imageFile = [tempObject objectForKey:@"image"];
NSData *imageData = [imageFile getData];
UIImage *image = [UIImage imageWithData:imageData];
destViewController.bandImageName = image;
NSLog(@"image is %@", image);
NSString *commentGet = [tempObject objectForKey:@"comment"];
destViewController.comment = commentGet;
这是照片控制器 viewDidLoad 的代码:
self.photoImageView.image = bandImageName;
self.commentLabel.text = comment;