简体   繁体   English

所有框架和静态库文件都编译到应用程序了吗?

[英]All framework and static library files compiled to app?

1、I am wondering whether Xcode compile all the .m sources of frameworks and .a to my app, for example, if I import UIKit framework and I only using UIButton.h, will all files in UIKit be compiled to my app? 1,我想知道Xcode是否将框架的所有.m源代码和.a编译到我的应用程序中,例如,如果我导入UIKit框架并且仅使用UIButton.h,是否会将UIKit中的所有文件都编译到我的应用程序中? what about static library? 静态库呢?

2、And if I import some frameworks in building my own static library, will the files of frameworks be compiled into .a? 2,如果我在构建自己的静态库时导入了一些框架,框架文件会被编译成.a吗?

Thanks in advance. 提前致谢。

Linking to standard frameworks like UIKit won't add any extra data to your binary. 链接到UIKit之类的标准框架不会将任何额外的数据添加到您的二进制文件中。 All of the standard frameworks are part of the OS so you're only making a reference to these frameworks. 所有标准框架都是操作系统的一部分,因此您仅参考这些框架。 However, any custom static libraries will have to be included because that compiled code is not a part of the OS. 但是,由于该编译代码不是操作系统的一部分,因此必须包含任何自定义静态库。

The same thing goes for your own library. 您自己的库也是如此。 Importing standard frameworks should not increase the size of your .a file. 导入标准框架不应增加.a文件的大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM