Swift Xcode 索引冻结或缓慢 [英] Swift Xcode Index Freezing or Slow

查看:33
本文介绍了Swift Xcode 索引冻结或缓慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许这只是我遇到了如此烦人的功能":

Maybe this is just me experiencing such an annoying "feature":

从 Xcode 6.0.1 升级到 Xcode 6.1 后,情况发生了变化.Xcode 6.1 永远索引项目或编译源文件.这个项目并不大.它只包含工作区中的一堆 Swift 文件和 AWS SDK 2.0 Cocoapods.我认为它不应该阻止整个索引和编译顺利.我尝试了一些 aws-sdk-ios-samples,只是为了看看 Xcode 6.1 如何在它们上工作,结果却一直在等待.

After upgrading from Xcode 6.0.1 to Xcode 6.1, things changed. Xcode 6.1 is forever indexing the project or compiling source files. The project is not a huge one. It just contains a bunch of Swift files and AWS SDK 2.0 Cocoapods in the workspace. I don't think it should prevent the whole to index and compile smoothly. I tried with some aws-sdk-ios-samples, just to see how Xcode 6.1 works on them, and it ended up in the same forever waiting.

到目前为止我尝试过哪些解决方案:

What solutions I have tried so far:

  1. 删除管理器中的派生数据",然后重新打开和工作区.(修复失败)
  2. 在 .xcodeproj 文件上显示包内容"并删除 .xcworkspace,如 (Xcode 4 - 慢性能)

不幸的是,它们都不起作用.

None of them worked, unfortunately.

附言也许我应该尝试重新创建该项目?我的电脑设置:MacBook Pro(Retina,13 英寸,2014 年中),内存 8 GB 1600 MHz DDR3,带优胜美地.(我认为这足以运行这个小项目.)

P.S. maybe I should try re-creating the project? My computer settings: MacBook Pro (Retina, 13-inch, Mid 2014), Memory 8 GB 1600 MHz DDR3, with Yosemite. (I think this is enough for running this small project.)

推荐答案

我尝试了上面的许多建议,包括拆分文件、安装 Xcode 6.2 beta 和破坏字符串连接语句.最终为我做的是将我用于测试数据的字典文字声明数组拆分为多个 .append 语句.

I tried many of the suggestions above including splitting files, installing Xcode 6.2 beta, and breaking string concatenation statements. What finally did it for me was splitting an array of dictionaries literal declaration I was using for test data into multiple .append statements.

// This causes indexing/building to hang...
var test = [ [ "a": false, "b": "c" ],
             [ "a": false, "b": "c" ],
             [ "a": false, "b": "c" ],
             [ "a": false, "b": "c" ],
             [ "a": false, "b": "c" ],
             [ "a": false, "b": "c" ] ]

// This works fine.
var test = [ [ "a": false, "b": "c" ] ]
test.append([ "a": false, "b": "c" ])
test.append([ "a": false, "b": "c" ])
test.append([ "a": false, "b": "c" ])
test.append([ "a": false, "b": "c" ])
test.append([ "a": false, "b": "c" ])

此外,就其价值而言,该数组中的第 6 个条目是导致我出现问题的原因;五个工作得很好.

Also, for what it's worth, the 6th entry in this array is what causes the issue for me; five works just fine.

这篇关于Swift Xcode 索引冻结或缓慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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