iphone - -all_load 链接器标志有什么作用?

在编译 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.

https://stackoverflow.com/questions/2906147/

相关文章:

objective-c - Objective-C 中的选择器?

iphone - 检测导航栏上的 'back' 按钮何时被按下

ios - 如何将 NSAppTransportSecurity 添加到我的 info.plist

objective-c - "Receiver type ' CALayer' 例如消息是前向声明”

ios - 如何使用 NSCache

objective-c - Swift 中的只读和非计算变量属性

ios - NSLocalizedString() 的第二个参数是什么?

iphone - 使用 CALayers 的圆形 UIView - 只有一些角落 - 如何?

objective-c - 这个 gdb 输出是什么意思?

objective-c - 如何使一个类符合 Swift 中的协议(protocol)?