2015-10-13 5 views
0

Я хочу нажать следующий контроллер, но неуспеха. Что я должен делать?collectionView, didSelectItemAtIndexPath some issue

-(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

ответ

0

вы должны установить идентификатор для ViewController и вызвать метод как

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

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

и убедитесь, что вы были встроены Навигационная View Controller.

+0

Спасибо за помощь. – runsheng0324

Смежные вопросы