Question
How to navigate from one view controller to another simply using a button's touch up inside event?
More Info
What I tried in a sample project, in steps, was:
Create the sample single view application.
Add a new file -> Objective-C Class with XIB for user interface (ViewController2).
Add a button into ViewController.xib and control click the button to ViewController.h to create the touch up inside event.
Go to the newly made IBAction in ViewController.m and change it to this...
- (IBAction)GoToNext:(id)sender { ViewController2 *vc2 = [[ViewController2 alloc] initWithNibName:@"ViewController2" bundle:nil]; [[self navigationController] pushViewController:vc2 animated:YES]; }
The code runs without errors and I tested the button's functionality with NSLog. However it still doesn't navigate me to the second view controller. Any help would be appreciated.
