0

I have to a set condition and make two starting points for launching my application.

I want to run

if(condition1 is true)
then display FirstloadViewController, otherwise display viewcontroller

After the launching method. I have tried this:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

    NSUserDefaults *fetchDefaults = [NSUserDefaults standardUserDefaults];
    NSInteger intValue = [fetchDefaults integerForKey:@"kIntegerKey"];
    NSLog(@"%i",intValue);
    if(intValue!=100)
    {
        self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
        self.firstloadViewController = [[FirstloadViewController alloc] initWithNibName:@"FirstloadViewController" bundle:nil];
        self.window.rootViewController = self.firstloadViewController;
        [self.window makeKeyAndVisible];
    }
    return YES;
}

but this error occurred while running it:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle

How can I solve this?

Veedrac
  • 58,273
  • 15
  • 112
  • 169

0 Answers0