Xcode IBDesignablesAgentCocoaTouch loads CPU infinitely?

爱⌒轻易说出口 提交于 2019-12-23 12:14:44

问题


I have a .xib file with extensive usage of IBDesignable views. As view grown I noticed constant CPU load. Now, my view is really big and when I open it in interface builder, ActivityMonitor show this: . It continues even if I leave .xib file and go to code. The only solution to stop it is to close, then open Xcode and don't open .xib file until it is really necessary. My rough assumption is that Xcode continues compiling my project/views in background to maintain IBDesignable views in actual state.

What should I do to prevent wasting CPU?

If it could make any sense - my mac configuration: MacBook Pro (Retina, 15-inch, Mid 2015), 2.5 GHz Intel Core i7, 16 GB 1600 MHz DDR3


回答1:


I've got pretty much same issue and solved it by removing all IBDesignable from project, but then I realized that you can just disable Automatically Refresh Views in Editor menu as mentioned here.

Issue returned later on just to some XIBs. The reason was Top Bar in Simulated Metrics on this view, which is really unexpected. Removing all simulated metrics solves CPU loading issue for me.



来源:https://stackoverflow.com/questions/41546591/xcode-ibdesignablesagentcocoatouch-loads-cpu-infinitely

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!