The project was recently re-debugged and a sinkhole was discovered. This paper studies the use of static libraries on some iOS:
First of all, we are directly to a running project to make a static library, most of the online first create a static library and then write the content, see my method.
1. Import the project into the overall project project, then delete the sub-project run file, and then create a static library inside!!! (Do not create the framework that, very pit.) I've been in the pit for a long time. To create a static library of. A. The name does not affect oneself to like can, I generally follow the original name to come.
2. Then add the link Build phases->target Dependencies and link Binary with Libraries inside the total project project to add the static library that we created ourselves.
3. We also need to make some configuration selection sub-projects within the sub-project, and then targets inside to choose the static library build phases->compile Sources This inside to add the implementation file you need (. m file) If there are many files, there is a lazy way to create a static library and then drag these files from the original project, Xcode will automatically add the implementation files. (I used to add more than 100 files myself, a bit annoying.) )
4. This leaves the final step, in the main project inside TARGETS-Build Settings, User Header Search Paths inside the location of the settings file. is the folder's location example:. /pkq/pkq. /is the meaning of the parent directory. Then there's a choice in this option recursive means traversing the entire file (sometimes it's not good to use.) )
5. So we can call our static library somewhere else 0v0
And then there are some points to note:
1. There is no such library libsqlite3.tbd these files in the static library. Add directly to the main project, and the bundle file will be added to the main project.
2. If the static library has the category Xcode is unable to load these files properly find the main project Target-Build Setting->linking change its other Linker Flags for:-all_load or-force _load can be. -all_load means that all the items are loaded into the general situation can be added this but the first will affect the speed of operation and sometimes other files are inexplicably error. The project I was working on has met this problem, and the previous project was mixed in C + + and then using-all_load there were many errors. This is the time to-force_load this tag, $ (srcroot)/. /VENDORS/BUILD/DEBUG-IPHONESIMULATOR/LIBVENDORS.A the path directly to the static and then delete the "" and then-force_load empty one grid.
And then to mention is that the framework Xcode created by the above is the default is the dynamic library, not the real machine can not be shelves. Then you could change to a static library. Target->mach-o Type is set to the static library. But this static library is. The framework is not able to use-force_load this label!!! (I finally have to delete this create a. A static library to pull the implementation file = =)
3. I don't know what else to pay attention to. The composition of the static library is left, because it is often troublesome to change the path. Then we synthesize the real machine and the simulator into a. a file. This is what we're going to do in the terminal. Then the target path has 2 operations 1.lipo-info Static library file so we know that the static library supports that mode. This is probably a look, but basically there is nothing to use 2. lipo-create DEBUG-IPHONEOS/LIBVENDORS.A debug-iphonesimulator/libvendors.a-output LIBVENDORS.A This is the instruction to synthesize a static library of 2 paths into a static library. Once the composition is successful, drag the new static library onto the original path to overwrite it.
If there is any problem with what I said above, please tell me that I am also a novice. I hope I can help you .
About the static library on iOS