ios library Other Linker Flags

set Targets Other Linker Flags value:-objC,-all_load,-force_load

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.

for example:

you will get a runtime exception of "selector not recognized" when linking against an objective-c static library that contains categories.then you will set -ObjC as Targets  Other Linker Flags value.it will be ok.

你可能感兴趣的:(ios,exception,xcode,library,archive,linker)