Hi,
When i create a iboutlet to my navigationController and try to add it to the currentview it isn't showing anything. Its really strange, when i initialize my navigationController in code and then add it to the view it works perfectly.
It even works when i make one in the mainWindows.xib and add it to the view in my applicationDidFinishLaunching method.
But as soon as i try to load it from another viewController it fails and i am left with a blank screen.
So it works when i add it programmatically or add it in my mainWindow.xib.
I have been trying for hours to get it working. It seems so simple, but i can't get it to work in other xib files.
My setup:
#import "RootViewController.h"
RootViewController *rootViewController=[[RootViewController alloc] init];
[window addSubview:rootViewController.navController.view];
My RootViewController has the ibOutlet to the navigationController.
Does anyone have a idea? I totally dont understand why this simple thing isn't working. What am i missing, its driving me crazy.
*UPDATE* The above code works if i change it to: I need to acces the rootViewController.view otherwise it won't work why?
#import "RootViewController.h"
RootViewController *rootViewController=[[RootViewController alloc] init];
if(rootViewController.view){
NSLog(@"nil");
}
[window addSubview:rootViewController.navController.view];
Thanks in advance!