本文介绍了Xcode IBDesignablesAgentCocoaTouch无限加载CPU?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.xib文件,广泛使用了IBDesignable视图.随着视图的增长,我注意到了恒定的CPU负载.现在,我的视图确实很大,当我在界面构建器中将其打开时,ActivityMonitor将显示以下内容:.即使我离开.xib文件并转到代码,它也会继续.停止它的唯一解决方案是先关闭,然后打开Xcode,然后再打开.xib文件,直到确实需要这样做为止.我的粗略假设是Xcode继续在后台编译我的项目/视图,以将IBDesignable视图保持在实际状态.

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.

我该怎么做才能避免浪费CPU?

What should I do to prevent wasting CPU?

如果可以的话-我的mac配置:MacBook Pro(Retina,15英寸,2015年中),2.5 GHz Intel Core i7,16 GB 1600 MHz DDR3

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

推荐答案

我遇到了几乎相同的问题,并通过从项目中删除所有IBDesignable来解决了这个问题,但是后来我意识到您可以在其中禁用Automatically Refresh Views Editor菜单已在此处中提及.

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.

问题稍后又返回到一些 XIB.原因是此视图中Simulated Metrics中的Top Bar,这确实是出乎意料的.删除所有模拟指标可以为我解决CPU负载问题.

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.

这篇关于Xcode IBDesignablesAgentCocoaTouch无限加载CPU?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-28 03:04