I want to create a navigation based application in Xcode 4.2. I have some UIButton
s in .xib. On button touch event I want show another screen. I've tried Page-Based Application
and Single-View Application
project templates.
Here is the code I'm using to push the view controller on button touch event:
- (IBAction)btnGoToNextPageAction:(id)sender {
NSLog(@"btnGoToNextPageAction is pressed");
Test2 *objTest2 = [[Test2 alloc] initWithNibName:@"Test2" bundle:nil];
[self.navigationController pushViewController:objTest2 animated:YES];
[objTest2 release];
}
But It only prints the NSLog
text and next page doesn't appear. I took reference from these links:
- Xcode 4.2 creating navigation based application
- Replacement for Navigation-based application template in Xcode 4.2?
I'm using .xib, not .storyboard.