When using a third-party SDK, you often encounter only one dynamic or static library that they provide and cannot get the source code. Using the dynamic library FrameWork or the static library Lib, you can satisfy the need not to show the specific implementation of the core code to the user, but also to avoid other people to change the code incorrectly.
First, the production of dynamic library FrameWork:
Open Xcode and select the Cocoa Touch FrameWork.
Create a new Publicmodel file, simple output log
If this Publicmanager file wants to expose the header file externally. Need
Then compile and get the dynamic library FrameWork
So far, a simple FrameWork has been created. The next step is to use the FrameWork.
Drag the FrameWork into the works. Introduction of #import <DynamicFrameWorkMake/PublicManager.h>
Publicmanager *manager = [[Publicmanager alloc] init];[ Manager Printlog:@ " This is a printed message "];
Compile run, you will find the introduction of the header file there is a warning "Missing submodule ' Dynamicframework.publicmanager '", the console will error:
You need to add the created FrameWork to the general Embedded Binaries.
The way to resolve the "Missing submodule ' Dynamicframework.publicmanager" warning is to add the "#import in the DynamicFrameWorkMake.h file when compiling the dynamic library. <DynamicFrameWorkMake/PublicManager.h>"
It is important to note that the build FrameWork is related to our chosen compilation environment, if you choose to compile the simulator, the import will be in the real machine run error, but also the Debug and Release mode points.
The following can be compiled from the FrameWork and simulator compiled by the real machine to merge.
Open Terminal, enter:
Lipo-create + Emulator directory + Real machine directory-output merged directory.
Eg: lipo-create/users/robin/library/developer/xcode/deriveddata/ Dynamicframeworkmake-fafcaqoabyywoqfahbpuzhfcltmd/build/products/debug-iphoneos/dynamicframeworkmake.framework /dynamicframeworkmake/users/robin/library/developer/xcode/deriveddata/ dynamicframeworkmake-fafcaqoabyywoqfahbpuzhfcltmd/build/products/debug-iphonesimulator/ Dynamicframeworkmake.framework/dynamicframeworkmake-output/users/robin/desktop/dynamicframework
If error:error:/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/lipo:can ' t move temporary file:/users/robin/desktop/dynamicframework to File:/users/zhangtibin/desktop/ Dynamicframework.lipo (is a directory)
IOS uses XCODE8 to make dynamic libraries and static libraries