开发者

"unrecognized selector sent to instance" in release mode and not in debug mode

I have an app which generate a lot of "unrecognized selector sent 开发者_开发技巧to instance" errors in Release mode an non in Debug. Do you have any idea on where can be the issue?

Thanks and regards,


Are you releasing for the same SDK (10.6, 10.5...) as your debug mode? You might be calling a method that only exists in 10.6. This should produce a warning, however. Are you taking care of warnings rather than ignoring them?


If you release an object before you're done using it, and another object gets allocated at the same address, sending a message intended for the old object will hit the new object, and if they're of different classes, you'll get that exception.

Run the static analyzer (or, better yet, turn it on to run on every build in your build settings). The static analyzer will show you the simpler bugs of this nature—the “low-hanging fruit”.

Then, run your application under Instruments's Zombies instrument. If you still have a bug of this kind (but too sophisticated for the static analyzer to spot), the Zombies instrument will put a flag in the timeline when you send a message to a should-be-dead object. You can then begin hunting down the bug from there. Repeat until there are no more crashes.


It probably occurs because you are linking a framework in one mode and not the other, make sure when you add frameworks you are linking that you are in "All Configurations".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜