0
我有2個視圖控制器 - 一個顯示圖像的collectionView,另一個是相應的細節視圖 - 非常基本。問題是collectionView中的項目由於某種原因無法選擇(觸摸但沒有任何反應)。此外,我沒有使用導航控制器來嵌入collectionView VC,更喜歡使用自定義按鈕來展開segue - 這個工作嗎?UICollectionView Segue沒有顯示細節VC
我建立了從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;
}
}
在詳細回去放鬆 – noobsmcgoobs 2014-11-06 06:34:57
@noobsmcgoobs展開將撤消你使用的任何前進segue。所以,如果你進行模態演示,那麼展開會解僱 - 如果你願意,這樣做很好。 – rdelmar 2014-11-06 06:47:33