此選擇一個視圖是代碼:的XCode 6:我無法通過其故事板ID
let theBoard = self.storyboard!
let vc = theBoard.instantiateViewControllerWithIdentifier("myViewId") as! UIViewController // this line causes the error
第二行導致此錯誤:
unexpectedly found nil while unwrapping an Optional value
*非常重要*:該錯誤僅在構建配置設置爲「debug
」時觸發。當設置爲「release
」時,它運行良好。
爲什麼?
你確定當你釋放它顯示你的目的地n故事板? –
絕對,在發佈視圖顯示 – Cherif
清理項目和重建 –