iOS development-Features-static libraries

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.