简体   繁体   English

有人在XCode 6中有此自动完成/语法突出显示问题吗?

[英]Anyone have this autocompletion/syntax highlighting issue in XCode 6?

While I'm coding, randomly the syntax highlighting stops working and same with the autocompletion in XCode 6. 在编写代码时,语法高亮显示会随机停止工作,并且与XCode 6中的自动完成功能相同。

If I close and reopen the project, it works again for a while, before the issue comes back within 5-15 mins. 如果我关闭然后重新打开该项目,它会再次工作一段时间,然后问题在5-15分钟内恢复。

Has anyone experienced this? 有人经历过吗? How did you fix it? 你怎么修好它的?

I can't seem to identify the cause. 我似乎无法找出原因。

I've had this happen a few times while developing for Swift using Xcode6 and it gets worse the bigger your project gets. 在使用Xcode6开发Swift时,我曾发生过几次这种情况,而且项目越大,情况就越糟。 It seems like every new version improves on this issue but non of them has been able to fully fix for me. 似乎每个新版本都对此问题进行了改进,但没有一个版本能够完全为我解决。 The only workaround I've found is to go to: 我发现的唯一解决方法是转到:

Window > Projects > Go to the derived data location for any of the projects and then delete the ModuleCache folder. 窗口>项目>转到任何项目的派生数据位置,然后删除ModuleCache文件夹。

I was having a similar problem with XCode 7 GM and didn't have any luck with the DerivedData approach (besides freeing up some well-needed disk space), but did manage to track down the problem. 我在使用XCode 7 GM时遇到了类似的问题,并且在DerivedData方法方面没有任何运气(除了释放了一些急需的磁盘空间之外),但是确实设法找到了问题所在。 For me, it was a line of code that was causing a) the syntax colouring to flicker on and off, and b) "segmentation fault: 11" on every build. 对我而言,这是一行代码,导致a)语法颜色忽明忽暗,以及b)每个构建版本均出现“分段错误:11”。 By commenting out bits and pieces of the code, I found that it was this line causing the problem: 通过注释掉部分代码,我发现正是这一行引起了问题:

query.findObjectsInBackgroundWithBlock{ (newObjects:[PFObject]?, error:NSError?) -> Void in

I changed newObjects to be [AnyObject]? 我将newObjects更改为[AnyObject]? and both the segmentation fault and syntax colouring were fixed. 并修复了分段错误和语法着色。 (It's a method from the Parse API.) (这是Parse API中的方法。)

query.findObjectsInBackgroundWithBlock{ (newObjects:[AnyObject]?, error:NSError?) -> Void in

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM