Trouble setting FIrst view controller which will appear on App Startup
Posted
by
Matte.Car
on Stack Overflow
See other posts from Stack Overflow
or by Matte.Car
Published on 2013-10-20T21:14:12Z
Indexed on
2013/10/20
21:54 UTC
Read the original article
Hit count: 218
I'm setting setting FIrst view controller which will appear on my App Startup. It should appear an UIView first time as a tutorial and, from second time, another standard view. In AppDelegate I wrote this:
#import "AppDelegate.h"
#import "TabBarController.h"
#import "TutorialController.h"
@implementation AppDelegate
TabBarController * viewControllerStandard; // standard view
TutorialController * viewControllerFirst; // tutorial view
@synthesize window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
if ([@"1" isEqualToString:[[NSUserDefaults standardUserDefaults] objectForKey:@"Startup"]]) {
window.rootViewController = viewControllerStandard;
} else { window.rootViewController = viewControllerFirst; }
[window makeKeyAndVisible];
return YES;
}
It doesn't return any alert but, launching app, after splashscreen, it appear only a black screen. Without that codes everything works fine. What could be wrong? Thank you!
© Stack Overflow or respective owner