我正在使用集合视图控制器来显示缩略图。点击缩略图,segue以模态方式打开整个图像。它可以在模拟器上正常工作,但不能在我的iphone或ipad上正常工作。完整的图像是空白的。 “评论”出现在所有设备中。解析数据图像显示在iOS模拟器中,但不在设备中
这里的SEGUE:
- (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;
在检索数据之前segue是否完成?仍然不知道为什么模拟器可以工作。 – user2490500