問題1 : Could not build module ‘MySDK’
原因是: 在pubulic的頭文件中導入的頭文件都需要導入到pubulic中, .m文件中頭文件不需要導入
問題2: Missing submodule ‘subHeader’
原因是: header的頭文件沒有全部導入到公共頭文件裏面
問題3:運行出現下面錯誤
dyld: Library not loaded:
@rpath/FXPlatformSDK.framework/FXPlatformSDK
Referenced from: /private/var/mobile/Containers/Bundle/Application/A9421C3E-5D63-4B0D-A9F9-D693891F16AA/FrameworkTest.app/FrameworkTest
Reason: image not found
(lldb)
原因是:自己的framework目前是動態庫,需要在General 中 Embedded Binaries 中添加自己的庫
蘋果是不允許自己開發的動態庫上線的,要想把自己的動態庫改爲靜態庫的話,在Build Setting 搜索mach 將Mach-O Type的值改爲Static Library 就行了
問題4: framework中的圖片顯示不出來
原因是:framework中是訪問不了圖片的, framework中的圖片要放到bundle中,跟SDK一起放到主程序裏面,圖片的調用方法可以寫成這樣:
+ (UIImage *)bundleImageNamed:(NSString *)name {
NSString *bundlefx_bundleImageName = [NSString stringWithFormat:@"MySDKxxx.bundle/%@",name];
return [UIImage imageNamed:bundlefx_bundleImageName];
}