单击“集合视图”单元格时,在ios 8中,连续图像未显示在目标控制器中
我使用标识符将集合视图单元格中的Segue添加到UIstoryboard中的目标控制器。我添加了以下代码以准备Segue委派。我还在目标控制器中创建了一个图像视图,并为图像视图分配了一个UIimage单击“集合视图”单元格时,在ios 8中,连续图像未显示在目标控制器中,ios,objective-c,uicollectionview,Ios,Objective C,Uicollectionview,我使用标识符将集合视图单元格中的Segue添加到UIstoryboard中的目标控制器。我添加了以下代码以准备Segue委派。我还在目标控制器中创建了一个图像视图,并为图像视图分配了一个UIimage if ([segue.identifier isEqualToString:@"third"]) { NSIndexPath *indexPath = [self.collection indexPathForCell:_cell]; fourV
if ([segue.identifier isEqualToString:@"third"])
{
NSIndexPath *indexPath = [self.collection indexPathForCell:_cell];
fourViewController *imageDetailViewController = (fourViewController *)segue.destinationViewController;
imageDetailViewController.pictures = [UIImage imageNamed:[self.list objectAtIndex:indexPath.row]];
[imageDetailViewController setTitle:@"Four"];
[self.collection deselectItemAtIndexPath:indexPath animated:NO];
}
我的怀疑:
单击单元格时,目标控制器中没有显示连续图像。为什么会发生这种情况?请帮助。有人能帮我吗?
[UIImage ImageName:[self.list objectAtIndex:indexath.row]
nil?设置图像时,fourViewController
中的代码是什么?在第四视图控制器中,我在.hfile和.m文件中分配了UIImage,我做了self.display.image=self.pictures;其中display-image-view;pictures-UIImage.Isself.display
nil当您尝试设置图像时?如果您改为这样设置:ImageDetailViewController.pictures=[UIImage imageName:@“AnImageFromYourBundle”]
,其中AnImageFromYourBundle
是有效的图像。是否有效?如果单击单元格,单元格中会显示其他图像。我还有其他疑问,是否需要在集合视图的did select行中添加PerformsgueWithIdentifier?