I am trying to navigate some view controller programatically. I have already add the UINavigationControllerDelegate in the header file...But the view didnt push out when I click the button..Can anyone tell did I do anything wrongly???
-(void)nextPage
{
NSLog(@"1234");
infoViewController* info = [[infoViewController alloc] init];
[self.navigationController pushViewController:info animated:YES];
info = nil;
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.navigationController.delegate = self;
startFutureView = [[UIView alloc] initWithFrame:CGRectMake(160, 0, 320, 548)];
startFutureView.backgroundColor = [UIColor redColor];
[self.view addSubview:startFutureView];
startPastView = [[UIView alloc] initWithFrame:CGRectMake(-160, 0, 320, 548)];
startPastView.backgroundColor = [UIColor blueColor];
[self.view addSubview:startPastView];
startInfoBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
startInfoBtn.frame = CGRectMake(80, 137, 180, 180);
[startInfoBtn addTarget:self action:@selector(nextPage) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:startInfoBtn];
// Do any additional setup after loading the view, typically from a nib.
}