- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
CocoasPod 很好,但有时又不好。
为什么?因为您的项目中有一个名为“-ObjC”的标志。
它将把所有对象文件拉入生成的二进制文件中。
例如,一个带有“pod 'AFNetworking'”且标志“-ObjC”打开的空项目,这将导致二进制文件为 7MB。一个空项目需要 7MB,太糟糕了。
某些框架(例如 Google Map SDK)需要启用“-ObjC”标志。
因此,如果您的项目包含“AFNetworking pod”和“Google Map SDK”,则会导致二进制文件为 17MB。
所以我的问题是:
如何关闭特殊库的“-ObjC”标志?
例如,只需保留 Google Map SDK 的“-ObjC”,但在 AFNetworking 上将其关闭。
最佳答案
您应该尝试回答 this question从而减小.ipa的大小。
In general, adding a static library to your project in Objective-C will pull ALL OBJECT FILES into your resulting binary because cocoa pods installation adds -ObjC flag to your linker settings, and as stated in linker manual:
-ObjC Loads all members of static archive libraries that implement
an Objective-C class or category.This flag included to solve problem with linking categories, because by default linker will not include object files containing only categories into resulting binary.
关于ios - 为什么 CocoasPod 会增加 IPA 大小?如何减小尺寸?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24325899/
CocoasPod 很好,但有时又不好。 为什么?因为您的项目中有一个名为“-ObjC”的标志。 它将把所有对象文件拉入生成的二进制文件中。 例如,一个带有“pod 'AFNetworking'”且标
我是一名优秀的程序员,十分优秀!