【发布时间】:2014-11-06 13:58:21
【问题描述】:
我有 2 个视图控制器 - 一个带有 collectionView 显示图像,另一个是相应的详细视图 - 非常基本。问题是由于某种原因无法选择 collectionView 中的项目(触摸但没有任何反应)。另外,我没有使用导航控制器将 collectionView VC 嵌入其中,而是更喜欢使用带有自定义按钮的 unwind segue - 这可行吗?
我建立了从 collectionView Cell 到 Detail VC 的连接。
在prepareForSegue中
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"detailSegue"]) {
LPDiaryDetailViewController *destViewController = segue.destinationViewController;
NSIndexPath *indexPath = [self.collectionView indexPathForCell:sender];
LocationImage *image = self.savedItems[indexPath.row];
destViewController.captionString = image.caption;
}
}
【问题讨论】:
标签: ios uicollectionview uistoryboardsegue