Original URL: http://www.jianshu.com/p/3439598ea61f
1. New Cocoa Touch Static Library project
New Project 2. Parameter settings for Xcode
- "Build Active Architecture only" is set to "NO"
- "iOS Deployment Target" is set to "iOS 7.0", which means that the compilation of IOS7.0 above system version is supported
Build Active Architecture only
IOS Deployment Target
Build phases uses the default settings
3. header file Add interface
. h file Add interface
. m file code implementation 4. Compile and build the static library. a file
- Select the real machine and the IPHONE6 emulator to compile separately
- First find the. A file that was successfully generated by the real machine compilation, Show in Finder
- Then find the. A file that was successfully compiled by the Iphone6 emulator (in the Real Machine directory command+ (the up-arrow key) to return to the previous-level folder path)
The Show in Finder found the successful. A file for the real machine compilation
For the real machine, the simulator is compiled successfully. a file
5. Synthesis of the general version of the Static library. a file
- Using a terminal for compositing operations
Lipo-create libstatictest.a (real machine. A file path) libstatictest.a (Iphone6 Simulator. A file path)-output save path/STATICTEST.A
Compositing using a terminal
- Synthetic. A file (supports IOS7 above system, real machine and simulator)
Synthetic static library file for general edition
6. Test your own made static library files
The. h and the synthesized generic version of the. A file are imported into the test project to implement the interface provided by the. H.
Test success
Wen/igeekxi (author of Jane's book)
Original link: http://www.jianshu.com/p/3439598ea61f
Copyright belongs to the author, please contact the author to obtain authorization, and Mark "book author".
"Go" iOS static library a file making process