1. overview :apple development , mainly provides two kinds of library : system comes with .framework.a file , mainly at compile time for call ; There is also a dynamic library , mainly .dylib end ( Span class= "S1" or directly for .o file .o files are linked to the project file for invocation. Apple currently only provides a static library package as the main ,.a static library encapsulation.
2. function : There are 2 major uses :1). Functional modularity for easy reuse ; 2). security source file internal implementation , protect the source file privacy.
3.Steps:Create a newProjectEngineering Documents->ChooseCocoa TouchStaticLibrary->Created for others to call. hAnd. mFile>To. hAnd. AFiles to match,Use. hThe interface functions provided in the file,function interfaces that need to be called by others need to be exposed to. h file-> because the framework is static library , So finally compile build .a file-> in Products> add .a file and corresponding .h header file ( note link binary with Library link in ) : actually .a file is .m The collection of files , based on the packaged .h file to invoke the corresponding .m file.
< Span class= "S4" > < Span class= "S1" > < Span class= "S4" > 4. Example: 1.2.3.456
< Span class= "S4" > < Span class= "S1" > < Span class= "S4" > 7.8.9.10
5. question :1). Note the release and debug versions in Product->scheme.
2). if the compiled . A file is red, the description does not succeed , you can switch the emulator and device Engineering directory to generate a black. A file.
3). note that the emulator because it is under the mac , CPU architecture is x86 and device's IPhone and Other devices under arm the schema is different , we can view the generated file lipo-info xxx.a, If you want to use the lipo-create .../ simulator /xxx.a .../ device /xxx.a -output .../ export position /xxx.a.
iOS development-Features-static libraries