collectionView didSelectItemAtIndexPath不起作用

时间:2016-04-03 14:50:43

标签: objective-c delegates uicollectionview

这是我的代码,不起作用

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    InfoViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"infoID"];

    [self.navigationController pushViewController:vc animated:YES];
}

是否也需要使用此方法?

- (BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    return YES;
}

无论如何,这没有帮助

0 个答案:

没有答案