1. Demand
We may develop some of our own in the work of developing iOS. A static library or package someone else's third-party class library into their own. a file. Sometimes when we introduce some C + + compiled third-party files, there may be compile errors, but if we package into. A static library, there will be very few OC and C + + mixed errors. The reason is simple. A static library file is a compiled binary file, and binary files and binaries are mixed with each other of course there is no problem. OK then let's start learning to pack!
2. Example
Next, we will afnetworking as an instance of the network request library that is commonly used in packaged iOS development.
1> we need to get ready to pack the Afnetworking
2> Next we start building a new project file named Wbafnetworking
3> Next we drag the prepared afnetworking into the project, noting that the files are placed in a first-level directory.
4> Next we choose to come up with a header file that needs to be exposed
I chose to expose all the header files as
5> Next we configure the project file
After the 6> configuration we can select the real machine to run after running we find the generated. A file right-click on the show in finder.
7. The. A file generated at this time only applies to the real machine, if we need the simulator can use the. a file in the same way to run on the emulator, and there are many online tutorials can be combined two. A file is not restated here.
iOS development, how to package a static library. A file