我应该在其他链接器标志中将“-ObjC 和-all_load”包含到我的所有 iOS 项目中吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8179869/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 15:27:18  来源:igfitidea点击:

Should I include "-ObjC and -all_load" in Other Linker Flag to all my iOS projects?

iphoneobjective-ciosxcode

提问by Howard

Possible Duplicate:
What does the -all_load linker flag do?

可能的重复:
-all_load 链接器标志有什么作用?

I see most static library require you to do it, so I add them in all of my projects, seems no side effect in adding this?

我看到大多数静态库都要求你这样做,所以我将它们添加到我所有的项目中,添加这个似乎没有副作用?

回答by Mathieu Hausherr

There is a side effect: build phase take much time.

有一个副作用:构建阶段需要很多时间。

-ObjC allow the static library to use objective-c specific stuffs like kvc or categories.

-ObjC 允许静态库使用objective-c 特定的东西,如kvc 或类别。

-all_load solve a bug in gcc/llvm, where -ObjC is not correctly used.

-all_load 解决了 gcc/llvm 中未正确使用 -ObjC 的错误。

回答by Marek Sebera

Read about why to use these flags in SO questions:

阅读有关为什么在 SO 问题中使用这些标志的信息:

What does the -all_load linker flag do?
Objective-C categories in static library

-all_load 链接器标志有什么作用?
静态库中的 Objective-C 类别

And then think about if you need to use them or not

然后考虑是否需要使用它们