2017-04-06 115 views
1

我想構建一個包含故事板包的靜態庫。無法加載靜態庫包故事板(尚未加載) - iOS

當我創建一個示例項目,並導入包和.h文件並運行它,我得到如下錯誤:

</Users/admin/Library/Developer/CoreSimulator/Devices/428755C3-5E9A-451F-AEAE-5BBD33506812/data/Containers/Bundle/Application/E3535CCC-F995-48E2-A26C-D8771E2109A1/testLibApp.app/testLibResources.bundle> (not yet loaded) 

這裏我所說的靜態庫,並希望呈現故事板視圖:

NSString * pathAndFileName = [[NSBundle mainBundle] pathForResource:@「testLibResources」ofType:@「bundle」];

NSBundle * resourceBundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@「testLibResources」ofType:@「bundle」]]; NSString * pathAndFileName = [resourceBundle pathForResource:@「testLib」 ofType:@「storyboard」];

當代碼運行,直到它崩潰並顯示爲上述錯誤日誌:

[一個NSBundle bundleWithPath:[[一個NSBundle mainBundle] pathForResource:@ 「testLibResources」 ofType:@ 「束」]];

有人知道如何加載靜態庫包故事板並將其呈現到當前視圖?

我也查了構建階段,包已經在包resoures補充說: enter image description here

回答

0

我有同樣的問題,可以通過在Xcode中刪除導出數據文件夾解決它(的Xcode /首選項/位置/派生數據)。同時從設備上刪除應用程序。