I use Xcode 6. I have several view controllers connecting together with present Seques(push). I set the initial point to navigation controller. My app loads with view or table view controller based on one circumstance. I embedded in Navigation controller using the editor menu. I can see the navigation controller before running, but it disappear in run time. Does any one know the reason?
I am suspicious to this part of my code in applicationdidfinishlaunchwithoption cause this problem:
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSInteger RegisteredFlagNumber = [defaults integerForKey:@"RegisteredFlag"];
bool isLoggedIn= (RegisteredFlagNumber==1) ? true:false;
NSString *storyboardId = isLoggedIn ? @"MainIdentifier" : @"LoginIdentifier";
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *initViewController = [storyboard instantiateViewControllerWithIdentifier:storyboardId];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = initViewController;
[self.window makeKeyAndVisible];
but I do not know how to fix it?