我有兩個視圖控制器,一個被稱爲Main
,另一個被稱爲InserirCodigoViewController
。我有一個叫做'contarParaMudar'的int
。我的代碼是:Xcode 6更改視圖控制器
-(IBAction)ok:(id)sender {
if (completeLevel == true) {
contarParaMudar = 1;
} else if (contarParaMudar == 1) {
UIStoryboard *mainStoryboar = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *vc = [mainStoryboar instantiateViewControllerWithIdentifier:@"InserirCodigoViewController"];
[self presentViewController:vc animated:YES completion:nil];
}
}
但我想以下幾點:當用戶打開應用程序和completeLevel = true
,在iphone必須直接加載InserirCodigoViewController
我能做些什麼? (對不起,我的英語不好)。
這能解決你的問題嗎? –