PushViewController 现在崩溃了
在一些工作代码中,我调用了 PushViewController,它从 xib 加载(成功)了一个新视图。
我进入 XIB 并添加了几个按钮。重试代码,视图继续显示在代码中的适当位置。
然后我删除了这些按钮,从那时起,代码就不再起作用了。现在它因未处理的异常错误而崩溃。我无法通过调试器跟踪它 - 它需要执行几个步骤才能进入代码并崩溃。
我可能在 IB 中断开了某些连接,但我不知道是什么。
任何人都可以对我所破坏的内容以及如何修复它提出任何建议吗?
预先感谢您的帮助。
In some working code, I had a call to PushViewController, which loaded (successfully) a new view from an xib.
I went into the XIB and added a couple of buttons. Retried the code, and the view continued to be displayed at the appropriate point in the code.
I then deleted those buttons, and since that point, the code no longer works. It now crashes with an unhandled exception error. I can't track it through the debugger - it takes a few steps into the code and crashes.
I've probably disconnected something in IB, but I don't know what.
Can anyone offer any suggestions as to what I've broken, and how to fix it?
Thanks in advance for your assistance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
大多数崩溃都是在过早释放的内存中发现的。
Most crashes are to be found in too early released memory.
如果您认为自己在 IB 中搞砸了,请查看每个元素的连接检查器 (cmnd + 2)。
If you think you've screwed up in IB, look at the Connections Inspector (cmnd + 2) for each element.
异常是什么?
调试器控制台中的输出将解释问题所在。
What's the exception?
The output in your Debugger Console will explain what the problem is.
确保您没有错误地断开 XIB 视图与文件所有者的连接。可能是一个插座,也可能不是,但视图仍然需要连接。
不知道 XIB 的详细信息很难判断,但这通常是常见情况。
make sure you didn't disconnect that XIBs view from File's Owner by mistake. Could've been either an outlet or not, but the view still needs a connection.
No knowing the details of your XIB is hard to tell, but that's usually a common case.