码迷,mamicode.com
首页 > 其他好文 > 详细

静态库调用中“unrecognized selector sent to instance”错误

时间:2014-11-04 14:26:24      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:style   blog   io   color   ar   sp   div   on   问题   

在开发调用静态库的中,出现 “unrecognized selector sent to instance 0x2b5f90”的错误

-[__NSCFConstantString xmlChar]: unrecognized selector sent to instance 0x2b5f90

 *** Terminating app due to uncaught exception ‘NSInvalidArgumentException‘, reason: ‘-[__NSCFConstantString xmlChar]: unrecognized selector sent to instance 0x2b5f90‘

  

因为是在已经封装好的静态库中,看不到源代码,一直找不到问题,分析应该是没有添加所依赖的系统框架或库导致的。

折腾了好久,所有要添加的框架都加了,还是没解决问题。最后请别人帮忙查问题,才发现是在静态库工程里的Other Linker Flags 的设置中 把“-ObjC” 写错为“-Objc

改为“-ObjC”后,编译之后,问题终于解决了。

 

一点点小失误造成这么大后果啊,浪费很多时间去找问题,要认真仔细啊。

静态库调用中“unrecognized selector sent to instance”错误

标签:style   blog   io   color   ar   sp   div   on   问题   

原文地址:http://www.cnblogs.com/samniu/p/4073383.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!