I cant seem to push this view controller and I must be doing something wrong. Code
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
button = [UIButton buttonWithType:UIButtonTypeCustom];
[button addTarget:self action:@selector(pushToStart) forControlEvents:UIControlEventTouchUpInside];
}
- (void)pushToStart
{
ViewController *view = [[ViewController alloc]init];
[[self navigationController] pushViewController:view animated:YES];
}
What am I doing wrong?
Create a UINavigationController programatically, or do it using Interface Builder – There are 100’s of tutorials online on how to do this. For example here