Open bingoogolapple opened 8 years ago
默认情况下framework是动态库,须在General->Enbedded Binaries中添加动态库才能运行,否则会报如下错误
dyld: Library not loaded: @rpath/MathTool.framework/MathTool
Referenced from: /Users/用户名/Library/Developer/CoreSimulator/Devices/508D83EC-8069-473A-83B3-41684EE669EF/data/Containers/Bundle/Application/BC87FC77-97A4-45F1-985A-E523C5105276/testframeworklib.app/testframeworklib
Reason: image not found
将framework动态库变为framework静态库
选中TARGET->Build settings->搜索mach->Linking里的Mach-O Type改为Static Library
开启调试功能,在不同的工程中调试「如果是在同一个工程中同时存在一个可运行的target和一个静态库的target则不需要配置该选项」
Build settings->Generate Debug Symbols->Yes
「如果有Bundle文件,不要打进Framework中,删掉xcode自动添加到Build Phases->Copy Bundle Resources中的Bundle,单独拷贝」
静态库的基本制作