I know there are quite a few threads about that topic, and I tried every single option. But nothing works.
So, here what I have, a loginviewcontroller and a tabbarviewcontroller. If the device is already registered, the tabbar should appear, if not the loginview. I have the tabbarviewcontoller as initial view controller in storyboard. This works if the device is registered. This is what I basically do:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
//define viewcontroller
LoginViewController *loginviewcontroller = [[LoginViewController alloc]init];
//check if device id in coredata
NSString *deviceId = [self retrieveFromUserDefaults:cKey_DeviceId];
if(deviceId == nil){
NSLog(@"device not registered");
[self.window setRootViewController:loginviewcontroller];
[self.window addSubview:loginviewcontroller.view];
}
//show them
[self.window makeKeyAndVisible];
return YES;
}
I have a NSlog output in my loginview viewdidload method, so I know, that the loginview is loaded. But the screen is black!!! I dont know why. The viewcontroller runs the viewdidload method, but there is just no screen output.
What do I do wrong???
thanks dominik