在 Objective-C 中遇到的最常见/不常见的错误消息是什么以及导致这些错误的原因是什么?
我一直在尝试维护一个我在开发过程中遇到的所有错误消息及其常见原因和修复的列表。您遇到的常见(和不常见)错误消息是什么?您是如何修复它们的?
I've been trying to maintain a list of all the error messages I ever encounter while developing and their common causes and fixes. What are the common (and the not so common) error messages you encountered and how did you fix them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
EXC_BAD_ACCESS
当引用指向已被dealloc
处理的对象的指针时EXC_BAD_ACCESS
when referencing a pointer that points to an object that has beendealloc
'ed一般来说,我发现 Objective-C 异常和错误消息是不言自明的。我认为,学习使用带有 Objective-C 异常断点的调试器来定位导致崩溃的特定行,比尝试编译解决常见错误的方法列表会更好。
也就是说,我认为经常引起混淆的一个不明显的错误是“无法识别的选择器 foo:发送到 BarClass”。虽然这是一个错误的原因应该很清楚,但回答这是如何发生的可能会更困难,而且我看到两个常见原因:
In general I find objective-c exception and error messages tO be self-explanatory. I think you would be better served by learning to use the debugger with breakpoints on objective-c exceptions to locate the specific line causing a crash than by trying to compile a list of recipies for resolving common errors.
That said the one non-obvious error I see as a frequent point of confusion is "unrecognized selector foo: sent to BarClass". While the reason why that is an error should be clear answering how that happened can be harder and I see two common causes: