首页 > 其他 > 详细

unrecognized selector sent to class 0x235e7ec

时间:2015-03-02 18:18:50      阅读:288      评论:0      收藏:0      [点我收藏+]

推断出问题的可能原因后,很有可能是工程的setting信息有问题。于是开始一个一个参数过,一开始以为是Search Paths的各种路径配置错误,后来验证不是。否则编译都应该过不去。
于是,将范围定在Build Settings下的Linking的参数列表。马上有一个参数映入眼帘:Other Linker Flags,没有设置。通过google,查询相关说明:

-all_load Loads all members of static archive libraries.

-ObjC Loads all members of static archive libraries that implement an Objective-C class or category.

-force_load (path_to_archive) Loads all members of the specified static archive library. Note: -all_load forces all members of all archives to be loaded. This option allows you to target a specific archive.

翻译过来就是-all_load就是会加载静态库文件中的所有成员,-ObjC就是会加载静态库文件中实现一个类或者分类的所有成员,-force_load(包的路径)就是会加载指定路径的静态库文件中的所有成员。所以对于使用runtime时候的反射调用的方法应该使用这三个中的一个进行link,以保证所有的类都可以加载到内存中供程序动态调用

到这里,基本就明白了,就是这个参数没有设置的原因。将Other Linker Flags=-ObjC,再重新调试,运行成功!

unrecognized selector sent to class 0x235e7ec

原文:http://www.cnblogs.com/appleboy/p/4309219.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!