Interface Builder 中的更改未显示在 SIMulator 或设备中

发布于 2024-10-16 01:16:33 字数 197 浏览 2 评论 0原文

我有一个使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

望她远 2024-10-23 01:16:33

我也有同样的经历。事实证明,我重命名了我的类和 xib 文件,但在另一个类中,我创建了视图:

MyNewViewController *myNewViewController = [[MyNewViewController alloc]
 initWithNibName:@"MyOLDViewController" bundle:nil];

一个疏忽,但令我惊讶的是,当我的项目中不存在此 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:

MyNewViewController *myNewViewController = [[MyNewViewController alloc]
 initWithNibName:@"MyOLDViewController" bundle:nil];

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.

注定孤独终老 2024-10-23 01:16:33

这听起来可能很简单 - 但您确定已将视图链接到 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

倾城月光淡如水﹏ 2024-10-23 01:16:33

我也有同样的经历。对我来说,修复方法是重置模拟器上的所有内容。

I also had the same experience. For me the fix was to reset all content on the simulator.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文