Objective c 如何从RootViewController转到SecondViewController

Objective c 如何从RootViewController转到SecondViewController,objective-c,viewcontroller,theos,Objective C,Viewcontroller,Theos,我已经搜索了几个小时没有好的答案,似乎很多人都有这个问题。。。我在iphone上使用theos,我有一个RootViewController,代码如下: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ [self performSegueWithIdentifier:@"SecondViewController.m" sender:nil]; }

我已经搜索了几个小时没有好的答案,似乎很多人都有这个问题。。。我在iphone上使用theos,我有一个RootViewController,代码如下:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

    [self performSegueWithIdentifier:@"SecondViewController.m" sender:nil];

}

单击时,表名方向上有一个表和一个单元格。我希望它显示我的第二个ViewController。m,我真的不知道该怎么做。PerformsgueWithIdentifier采用一个段的名称。它不采用视图控制器的名称,特别是不采用包含视图控制器的文件的名称。它旨在与故事板一起使用


如果您的rvc中有导航堆栈,请查看UIViewController的presentViewController或NavigationController的pushViewController。

您的segue真的被称为“SecondViewController.m”吗?在故事板中命名你的segue,并在代码中使用该名称。m文件是源文件。真的吗?我清楚地说我用的是theos,没有故事板对不起,我没有看到(你应该在别的地方说得更清楚,而不是在标签上)。不管怎样,你的segue是如何创建的?它们是如何命名的?Segue是两个视图控制器之间的转换,因此不能用这样的名称来标识它。如果尚未创建segue,请不要将其用于转换。我不知道如何通过按UIButton从我的RootViewController转到我的SecondViewController。您知道如何操作吗?首选方法是使用
UINavigationController
及其方法
pushViewController
,但是您可以简单地使用任何
UIViewController
presentViewController