0

i want to push next controller,but unsuccess.what should i do?

-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath:indexPath];

    NSInteger section = indexPath.section, row = indexPath.row;

 if (section == 1) {

        if (row == 0) {

            DetailsViewController *  DetailsVC = [DetailsViewController alloc]init];

            [self.navigationController pushViewController: DetailsVC animated:YES];
        } else if (row == 1) {
              }
    } else if 
(section == 2) {

    }

}

enter image description here

Johnny Bones
  • 8,786
  • 7
  • 52
  • 117

1 Answers1

0

you have to set identifier for viewcontroller and call the method like

 CallViewController *vc=[self.storyboard instantiateViewControllerWithIdentifier:@"CallViewController"];

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

and be sure you had embedded Navigation View Controller.

vp2698
  • 1,783
  • 26
  • 28