zoukankan      html  css  js  c++  java
  • 【iOS】Xcode中的all_load与ObjC

    在引入静态库时,通常需要在"Other Linker Flags"中添加-all_load和-Objc属性,注释如下:

    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.

    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.

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

    转自:“http://blog.csdn.net/workhardupc100/article/details/7350809”

  • 相关阅读:
    3.12
    3.11
    安卓开发
    安卓开发
    安卓开发
    安卓开发
    安卓开发
    安卓开发
    安卓开发
    安卓开发
  • 原文地址:https://www.cnblogs.com/ftrako/p/2759288.html
Copyright © 2011-2022 走看看