2016-09-27 57 views
0

(次)故事板,我想在我的應用程序負載的次級故事板Test.storyboard(旁邊Main.storyboard),像這樣:無法找到名爲Test.storyboard

let storyboard = UIStoryboard(name: "Test.storyboard", bundle: nil) 

Test.storyboard駐留在一個組裏面Test,它被標記本地化爲Base(因此其相對於組的位置報告爲Base.lproj/Test.storyboard),並且它也標記爲我應用目標中的目標成員資格。當我在模擬器上運行應用程序時,我可以確認文件Base.lproj/Test.storyboardc存在於應用程序的主包中。

然而,以上代碼生成此錯誤:

Could not find a storyboard named 'Test.storyboard' in bundle ... 

什麼是成功地打包和負載的次級故事板等礦的正確方法?

+0

我認爲它有助於您http://stackoverflow.com/a/24840376/6619234 – seggy

回答

0

你不需要加載故事板與.storyboard擴展。使用喜歡這個

let storyboard = UIStoryboard(name: "Test", bundle: nil) 
相關問題