-3

I have search for hours with no good answers and it seems a lot of people have this issue... I am using theos on my iphone and I have a RootViewController with this code:

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

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

}

There a table and a cell on the table name directions when its clicked I want it to display my SecondViewController.m, I honestly have no idea what or how to do this.

ErasmoOliveira
  • 1,416
  • 2
  • 20
  • 40
  • Is your segue really called "SecondViewController.m" ? Name your segue in the storyboard and use that name in the code. .m files are source files. – Jean-Baptiste Yunès Apr 01 '15 at 18:51
  • Really? I clearly stated im using theos there is no storyboard –  Apr 01 '15 at 19:44
  • Sorry I didn't saw (you should have state it more clearly somewhere else than in tag). Anyway, how your segue are created ? How they are named ? Segue is a transition in between two view controllers, so it can't be identified by such a name. If you haven't create segue, don't use them for transitions. – Jean-Baptiste Yunès Apr 02 '15 at 05:48
  • I have no idea how to go from my RootViewController to my SecondViewController by pressing a UIButton do you know how? –  Apr 02 '15 at 06:25
  • The preferred way is to use a `UINavigationController` and its method `pushViewController`, but you can simply use the `presentViewController` of any `UIViewController`. – Jean-Baptiste Yunès Apr 02 '15 at 08:15
  • But what would be the codes? –  Apr 02 '15 at 18:11
  • I gave you classes and methods... – Jean-Baptiste Yunès Apr 02 '15 at 18:48
  • I figured it out using a UIView –  Apr 03 '15 at 00:56
  • You told us about view controllers... Read the docs, there is `UIView`'s methods to manage the stack of views. (`addSubview:`, etc). – Jean-Baptiste Yunès Apr 03 '15 at 05:11

1 Answers1

0

performSegueWithIdentifier takes the name of a segue. It does not take the name of a view controller, and especially not the name of a file containing a view controller. It is intended for use with storyboards.

Take a look at UIViewController's presentViewController, or NavigationController's pushViewController if you have a navigation stack in your rvc.

Gruntcakes
  • 37,738
  • 44
  • 184
  • 378