当我想要打开新视图并且我不知道它是什么意思时,我有这个错误。 我运行该代码:
func openMenu(){
let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let vc: UIViewController = storyboard.instantiateViewControllerWithIdentifier("MenuViewController") as UIViewController
self.presentViewController(vc, animated: true, completion: nil)
}
错误是:
警告:尝试显示其视图不在窗口层次结构中!
我有Swift代码:
Swift
我想用Objective-C执行Swift代码。
Objective-C