The following code below is attempting to implement a method where my navigation controller launches to on e of two different views. The problem is that I keep getting a black screen whenever my application launches.
#import "SugarCRMReleaseOneAppDelegate.h"
#import "SettingsViewController.h"
#import "ModuleViewController.h"
@implementation SugarCRMReleaseOneAppDelegate
@synthesize window;
@synthesize navigationController;
#pragma mark -
#pragma mark Application lifecycle
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after app launch
NSString *a2 = [[NSString alloc] init];
a2 = [[NSUserDefaults standardUserDefaults] objectForKey:@"savedUsername"];
NSString *b2 = [[NSString alloc] init];
b2 = [[NSUserDefaults standardUserDefaults] objectForKey:@"savedPassword"];
[window makeKeyAndVisible];
if(a2 == nil && b2 == nil) {
SettingsViewController *viewController1 = [[SettingsViewController alloc] initWithNibName:@"SettingsViewController" bundle:nil];
[navigationController initWithRootViewController:viewController1];
[window addSubview:[navigationController view]];
[viewController1 release];
}
else {
ModuleViewController *viewController2 = [[ModuleViewController alloc] initWithNibName:@"ModuleViewController" bundle:nil];
[navigationController initWithRootViewController:viewController2];
[window addSubview:[navigationController view]];
[viewController2 release];
}
[UIApplication sharedApplication].idleTimerDisabled=YES;
return YES;
}