X $ C $ç保持每次击键后,故事板建设 [英] Xcode keeps building storyboard after each keystroke

查看:201
本文介绍了X $ C $ç保持每次击键后,故事板建设的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用在一个非常奇怪的状态进入了一个故事板最近我的X code项目:X code不断建设整个项目,尤其是故事板后的每个键preSS 的。我认为没有理由对这种行为无论是在我的项目版本比较的所有有趣的文件(故事板和项目)既不是X code(也许我只是找不到它?)不用说,这个功能使得工作设置我的项目几乎是不可能的,因为CPU是不断与重建故事板占用,当我键入新的code。任何人都看到了这一点?

My Xcode project using a storyboard entered in a very weird state recently: Xcode keeps building the whole project and notably the storyboard after each keypress. I found no reason for this behavior neither in my project diffing all interesting files (storyboard and project) neither a setting in Xcode (maybe I just could not find it?) Needless to say that this "feature" makes working on my project nearly impossible since the CPU is constantly occupying with rebuilding the storyboard when I type new code. Anybody seen this?

推荐答案

这是由<$ C $ç> IB_DESIGNABLE 源头文件的定义引起的。也许它使问题只如果包含头文件 IB_DESIGNABLE 包含(甚至隐含的)当前正在编辑的源文件。

It is caused by the IB_DESIGNABLE definitions in the source header files. Probably it makes problem only if the header file containing IB_DESIGNABLE is included (even implicitly) to the source file you are currently editing.

我没有找到一个明确的解决方案如何禁用 IB_DESIGNABLE ,因此编译故事板和源文件不断。我想AP preciate一个X code标志暂时禁用此。我也试过围绕 IB_DESIGNABLE #IFDEF 宏,但它们被认为即使# IFDEF 计算为false。一个注释掉一个 IB_DESIGNABLE 帮助,但它不是与许多 IB_DESIGNABLE 是个可行的解决方案。

I did not find a definitive solution how to disable IB_DESIGNABLE and thus compiling the storyboard and the source files continuously. I would appreciate an Xcode flag to disable this temporarily. I tried also surrounding the IB_DESIGNABLE with #ifdef macros but they are considered even if the #ifdef evaluates to false. Commenting out one by one the IB_DESIGNABLE helps but it is not a feasible solution with many IB_DESIGNABLEs.

更新

我终于找到了一个快速的方法来避免这种令人讨厌的行为。有在活动窗口中打开的故事板,禁用自动刷新意见,从编辑器菜单。这将停止更新在使用自定义code,因而显著加快开发故事板编辑的意见。当你再次需要只是在实时编译有您的自定义code的可视preVIEW,再次启用该选项(看来你也必须重新打开你的故事板,使其再次合作)。

I finally found a quick way to avoid this annoying behavior. Having the storyboard opened in the active window, disable "Automatically Refresh Views" from the Editor menu. This will stop updating the views in the storyboard editor that use your custom code and thus speed up your development significantly. When you need again the just-in-time compiling to have a visual preview of your custom code, enable this option again (it seems you also have to re-open your storyboard to make it working again).

这篇关于X $ C $ç保持每次击键后,故事板建设的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆