在编译 Objective-C 代码时,我无法找到 -all_load 标志的作用。
我在将二进制文件上传到 Apple 时遇到了一些问题,他们说这是因为我没有使用此标志,但即使没有它,我的代码也能编译。
有人可以帮我吗?
谢谢
最佳答案
可能与这篇技术说明 https://developer.apple.com/library/content/qa/qa1490/_index.html 有关
IMPORTANT: For 64-bit and iPhone OS applications, there is a linker bug that prevents -ObjC from loading objects files from static libraries that contain only categories and no classes. The workaround is to use the -all_load or -force_load flags. -all_load forces the linker to load all object files from every archive it sees, even those without Objective-C code. -force_load is available in Xcode 3.2 and later. It allows finer grain control of archive loading. Each -force_load option must be followed by a path to an archive, and every object file in that archive will be loaded.
关于iphone - -all_load 链接器标志有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2906147/