您的位置:首页 > 其它

-force_load (加载静态库崩溃)

2015-09-09 22:01 295 查看

-force_load

Crash Log:

Last Exception Backtrace:

0 CoreFoundation 0x2f087f06 __exceptionPreprocess + 126
1 libobjc.A.dylib 0x3981ece2 objc_exception_throw + 34
2 CoreFoundation 0x2f08b832 -[NSObject(NSObject) doesNotRecognizeSelector:] + 198
3 CoreFoundation 0x2f08a132 ___forwarding___ + 702
4 CoreFoundation 0x2efd9094 _CF_forwarding_prep_0 + 20
5 AmazingBOX 0x0036cebe -[RHAddressBookSharedServices init] (RHAddressBookSharedServices.m:124)

6 AmazingBOX
0x0036cc62 +[RHAddressBookSharedServices sharedInstance] (RHAddressBookSharedServices.m:98)

原因:

Project引用了RHAddressBook库,其中有catagory类NSThread+RHBlockAdditions.h。

因此,需要在other linker flag里面使用-ObjC、-force_load或者-all_load。

解决:修改链接参数(Other Linker Flag)

1.去掉-ObjC、 -all_load参数(这个参数会强制所有的静态链接库都加载其中的category);

2.改为逐一加载Three20的各个静态库,即修改链接参数(Other Linker Flag)为如下形式:
-force_load $(SRCROOT)/RHAddressBook/libRHAddressBook.a
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: