iOS错误处理之[__NSArrayM 某一方法名:]: unrecognized selector sent to instance

我们在进行iOS开发时,经常会遇到一些某名的错误,程序一运行,就会退到main函数中报错,搞的我们一头雾水!

例如:

-[__NSArrayM isEqualToString:]: unrecognized selector sent to instance 0x661de40
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM isEqualToString:]: unrecognized selector sent to instance 0x661de40'

这是我们会无从下手处理这样错误,明明调用方法的对象是NSString,为什么出现这样的错误呢


下面我们看看

This is a classic double release error. An object has been released too many times, the memory it occupies has been assigned to another object, so that other object is receiving messages meant for the old object.

这是stackoverflow上面大神给的回答,意思就是我们的对象被release了多次,导致僵尸指针。

此时我们可以打开僵尸指针检测,来确实报告的具体位置。

你可能感兴趣的:(iOS常见错误)