我必须设定条件并为启动我的应用程序提出两个起点。
我想跑
if(condition1 is true)
然后display FirstloadViewController
,
否则display viewcontroller
启动方法后。我试过这个:
- (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;
}
但运行时出现此错误:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle
我该如何解决这个问题?