Interface Builder 中的更改未显示在 SIMulator 或设备中
我有一个使用 Interface Builder 中的默认按钮和背景创建的视图。该应用程序运行正常。我将 .png 背景图像添加到视图和按钮中。构建应用程序并运行它,但更新不会显示。
我还尝试过一些简单的操作,例如更改按钮的文本或添加另一个按钮,但更改不会传播。
我已经清理了目标,在 Finder 中手动删除了构建,并关闭了计算机。我还缺少什么?
I have a view that I created using default buttons and background in Interface Builder. The app runs properly. I added .png background images to the view and to the buttons. Build the app and run it and the updates do not show.
I've also tried something simple like changing the text of the button or add another button and the changes are not propagating.
I've cleaned targets, manually deleted builds in Finder, and have shutdown the computer. What else am I missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我也有同样的经历。事实证明,我重命名了我的类和 xib 文件,但在另一个类中,我创建了视图:
一个疏忽,但令我惊讶的是,当我的项目中不存在此 Nib 文件时,它设法使用(可能是缓存的?)旧 Nib 文件成功构建......并且应用程序愉快地运行,尽管显示了过时的界面。
更正传递给 initWithNibName 的内容立即解决了我的问题。
I had the same experience. It turned out that I'd renamed my class and my xib file, but in another class I was creating the view with:
An oversight, but the surprising part to me is that when this Nib file didn't exist in my project, it managed to build successfully using a (presumably cached?) old Nib file... and the application happily ran, though showing an out of date interface.
Correcting what was passed to initWithNibName immediately corrected the issue for me.
这听起来可能很简单 - 但您确定已将视图链接到 Interface Builder 中的视图控制器吗?我以前做过,只是忘记链接它们
This might sounds easy - but are you sure you linked up the view to the view controller in Interface Builder? I've done it before where I just forget to link them
我也有同样的经历。对我来说,修复方法是重置模拟器上的所有内容。
I also had the same experience. For me the fix was to reset all content on the simulator.