Ios 单击TableViewCell时是否可以将视图更改为ViewController?

Ios 单击TableViewCell时是否可以将视图更改为ViewController?,ios,objective-c,Ios,Objective C,我不熟悉Objective-C 它有TableViewCell和ViewController上的TableView,如下图所示 单击TableViewCell时,我想将视图更改为另一个Viewcontroller 但是,如果不使用UINavigationController,则似乎无法使用performsguewithidentifier更改中的视图,错误日志如下所示: Push segues can only be used when the source controller is man

我不熟悉Objective-C

它有
TableViewCell
ViewController
上的
TableView
,如下图所示

单击
TableViewCell
时,我想将视图更改为另一个
Viewcontroller

但是,如果不使用
UINavigationController
,则似乎无法使用
performsguewithidentifier
更改
中的
视图
,错误日志如下所示:

Push segues can only be used when the source controller is managed by an instance of UINavigationController.'
当我点击
表格视图单元格
时,是否有其他方法将视图更改为另一个
视图控制器


提前感谢。

您可以使用此

 -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
    yourViewController *vc = [[yourViewController alloc]initWithNibName:@"yourViewController" bundle:[NSBundle mainBundle] ];  
        [self presentViewController:vc animated:YES completion:nil];

    }
在界面生成器(情节提要)中,单击以下内容:

Push segues can only be used when the source controller is managed by an instance of UINavigationController.'


正是调试器所说的:
Push segues只能在源控制器由UINavigationController的实例管理时使用。
然后您就可以推送segues了。

yourViewController*vc=[[yourViewController alloc]initWithNibName:@“yourViewController”处出现了错误
Expected identifier
bundle:[NSBundle mainBundle]]。您知道错误发生的原因吗?#导入“yourViewController”