抱歉關於倒票 - 我不認爲你應得的。我在啓動iOS時遇到了同樣的問題。這可能有幫助
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//set NSDefaults when you set if password protection is needed - here you are checking to see if password enabling exists
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
BOOL passwordExists;
passwordExists = [defaults boolForKey:@"hasCompleted"];
//jump to different view controller depending if BOOL is false or true
//set names (ShowLogInScreenController) In StoryBoardID in the Interface Builder
UIStoryboard *storyBoard =[ UIStoryboard storyboardWithName:@"Main" bundle:nil];
UINavigationController *vc = [storyBoard instantiateViewControllerWithIdentifier:passwordExists ? @"ShowLogInScreenController" : @"PasswordProtectionDisabledViewController"];
UINavigationController *questionsNavigationController = [[UINavigationController alloc] initWithRootViewController:vc];
questionsNavigationController.navigationBar.hidden = YES;
self.window.rootViewController = questionsNavigationController;
return YES;
}
你能顯示你試過的代碼嗎? –