[英]Xcode storyboard changes not showing on device or simulator
This is driving me nuts. 这让我疯了。
My app was running normally and then I don't know what I did but any changes I now make in the storyboard/
IB/
Xibs
etc are not updating when I run the app either on real device or simulator. 我的应用程序正常运行然后我不知道我做了什么,但我现在在storyboard/
IB/
Xibs
等中所做的任何更改都没有在我在真实设备或模拟器上运行应用程序时更新。 For instance, I changed the textColor
of UILabel
but when I run the app, the old color still shows both on device or simulator. 例如,我更改了UILabel
的textColor
,但是当我运行应用程序时,旧颜色仍然显示在设备或模拟器上。 I am using Xcode Version 7.3.1. 我正在使用Xcode版本7.3.1。
Please help. 请帮忙。 Thanks 谢谢
This solution had worked for me: 这个解决方案对我有用:
Just delete that storyboard in which changes are not reflecting and take new storyboard instead it will start reflecting changes. 只需删除那些没有反映变化的故事板,然后取出新的故事板,它就会开始反映变化。
Hopefully to save someone some frustration, I had this same problem and figured out that I must have accidentally hit Command+d while trying to copy something and duplicated the scene. 希望为了节省一些挫折感,我遇到了同样的问题,并且发现在尝试复制某些内容并复制场景时我必须意外地击中Command + d。 The duplicate was laid perfectly over the original so I couldn't tell I was editing the duplicate instead of the actual scene linked to my navigation controller. 副本完全放在原件上,所以我不知道我正在编辑副本而不是链接到导航控制器的实际场景。 I was so focused on the problem I didn't notice the new warning for an unreachable scene in my storyboard. 我非常专注于这个问题,我没有注意到我的故事板中一个无法访问的场景的新警告。
When you have the simulator open. 当你打开模拟器时。
(nb: when using device to run app, I would delete it from app as well) (nb:使用设备运行应用程序时,我会从应用程序中删除它)
Then Go back to Xcode 然后回到Xcode
I've tried to simulate the issue you're having but unable to, however, when I have any issues on running my apps, the above seems to work. 我试图模拟你遇到但无法解决的问题,但是,当我在运行我的应用程序时遇到任何问题时,上面似乎都有效。
[ Sometimes Xcode can be a bit slow, so I tend to wait a few seconds to confirm it / Xcode has actioned it, as I sometimes used the keyboard too fast for it to keep up.] [有时Xcode可能有点慢,所以我倾向于等待几秒钟确认它/ Xcode已经采取行动,因为我有时候使用键盘太快而无法跟上它。]
Hope this helps! 希望这可以帮助!
当我的Main.storyboard没有保存时(它的文件图标在clean + build之后仍然是灰色的),我发现在我的终端中运行git add -u
和git commit -m "//your comment"
会改变Main.storyboard文件图标再次变黄(不是灰色)
Try removing all constraints from the changes you made and then reapply them. 尝试从您所做的更改中删除所有约束,然后重新应用它们。 That is what worked for me. 这对我有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.