哦~各位大神


求助哦~~各位大神
 * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDate string]: unrecognized selector sent to instance 0x1342af90'

* First throw call stack:

(0x278b012 0x24a1e7e 0x28164bd 0x277abbc 0x277a94e 0x154248d 0x1542674 0x1d6e1e 0x1eed0d5 0x1eed034 0x2d2c5b7 0x2d16dce)

libc++abi.dylib: terminate called throwing an exception

(lldb) 





报这个错一般是什么情况导致的,  时不时会因为这个程序泪奔,,

移动开发 ios 程序开发

joehee 12 years, 10 months ago

错误信息已经给出提示了:unrecognized selector sent to instance 

报错的原因是,你在试图给NSDate 类型发送string消息,但因NSDate 没有string 的定义,故而找不到string消息而导致程序crash.


解决方法:

Debug时,断点找到出错代码的具体位置,看一下那个对象的具体类型,判断一个对象是否能响应某个消息可以使用isResondToSelector来判断。

Kaiya answered 12 years, 10 months ago

Your Answer