Hi all,
I have a problem to push a view in a Navigation Controller embedded in a Tab Bar Controller. Here is the structure of the app:
- App hosts the Tab Bar and a Delegate
- One of the view controllers stacked in the Tab Bar is a Navigation Controller
- This Nav Controller hosts the Nav Bar and delegate to File's owner > FirstViewController class & FirstView.xib
- This xib contains a tableview. On an item click, I would like to push a new view to the Nav Controller > FirstViewDetailsController & FirstViewDetails.xib
- FirstViewDetails is a simple UIview.
>> The code in the click event method in FirstViewController:
NSString *nibName = @"FirstViewDetails";
UIViewController *targetViewController = [[FirstViewDetailsController alloc] initWithNibName:nibName bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:targetViewController animated:YES];
>> The code in nibNameOrNil method in FirstViewDetailsController:
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
NSLog(@"First View Details initNIB %@", nibNameOrNil);
// Custom initialization
}
RESULT:
- First View Details initNIB FirstViewDetails is displayed in log window => event is fired correctly and FirstViewDetails seems to be constructed correctly
- The UIView FirstViewDetails is not stacked nor displayed
Thanks for your help.