0

我有ARC的Cocoa Touch项目,有时会出现此错误。你能向我解释这种错误的种类和解决方法吗?可可触摸项目与ARC错误:[__NSCFString deviceOrientationDidChange:]:无法识别的选择器

-[__NSCFString deviceOrientationDidChange:]: unrecognized selector sent to instance 0x1ddf81a0 

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString deviceOrientationDidChange:]: unrecognized selector sent to instance 0x1ddf81a0' 
*** First throw call stack: 
(0x313132a3 0x38fad97f 0x31316e07 0x31315531 0x3126cf68 0x31264037 0x31b7a599 0x33121c65 0x3311c3db 0x3311b6cd 0x3311b11b 0x34e1c5a3 0x34e1c1d3 0x312e8173 0x312e8117 0x312e6f99 0x31259ebd 0x31259d49 0x34e1b2eb 0x3316f301 0x14b61 0x14ae8) 
libc++abi.dylib: terminate called throwing an exception 

回答

1

你看到这个崩溃什么做ARC和一切与对象做(这似乎是一个NSCFString对象)正在接收一个虚假的“deviceOrientationDidChange:”的消息。

我的建议是在“deviceOrientationDidChange”上设置一个符号断点并捕获正在发送的消息,然后您就会知道哪行代码被破坏了。

+0

哪里(如何)我可以找到deviceOrientationDidChange来设置符号断点? – 2013-02-20 08:47:36

2

你有一个僵尸问题。如果你可以在模拟器上复制它,在僵尸工具下运行它。如果您只能在设备上进行复制,请修改您的方案,进入“诊断”标签,然后打开僵尸复选框。 (仪器不提供设备上的僵尸检测,不幸的是。)

+0

谢谢,我认为它对我非常有用,我不知道它 – 2013-02-20 08:55:04