0
我想打電話給一個故事板的場景從的appDelegate [storyboard ID : MyScene]
,通話故事板的場景從應用委託
我已經搜查,並試圖對堆棧溢出考慮到許多答案!但找不到工作解決方案。
一個我試過的代碼,
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle: nil];
UIViewController *sc= (UIViewController *)[mainStoryboard instantiateViewControllerWithIdentifier:@"MyScene"];
[self.window.rootViewController presentViewController:sc animated:YES completion:nil];
你寫的代碼,可以嘗試使用一些延遲 – Wolverine
檢查「主要」是實際存在的,你是不是在mainStoryboard獲得零值。 – mohsin
感謝回覆@Wolverine,我在應用程序代理的didFinishLaunchingWithOptions中寫了此代碼。 –