【发布时间】:2026-02-13 23:50:01
【问题描述】:
我正在开发一个 swift 应用程序,在某些时候我有一个类似这样的代码:
import UIKit
class ViewController: UIViewController {
private var a: UIImageView!
private var b: UIImageView!
private var c: UILabel!
private var d: UILabel!
private var e: UILabel!
private var f: UILabel!
private var g: UIView!
private var h: UIView!
private var i: UIView!
private var j: UIView!
private var k: UIImageView!
private var l: UIView!
private var m: UIView!
private var n: UIView!
private var o: UIView!
private var p: UIScrollView!
private var q: UIView!
override func viewDidLoad() {
super.viewDidLoad()
let viewBindingsDict = ["a" : a,
"b" : b,
"c" : c,
"d" : d,
"e" : e,
"f" : f,
"g" : g,
"h" : h,
"i" : i,
"j" : j,
"k" : k,
"l" : l,
"m" : m,
"n" : n,
"o" : o,
"p" : p]
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
由于某种原因,当我添加此代码时,xcode 卡住了,我无能为力。
打开Activity Monitor,显示sourcekitservice和swift使用超过100%的CPU。
我用上面的代码创建了这个示例项目:https://dl.dropboxusercontent.com/u/1393279/aaaaaaa.zip
我已经尝试过清理派生数据、重新安装 Xcode、重新启动、等待几分钟等。它只是不起作用。
【问题讨论】:
-
我已经让 Xcode 6 的各种测试版在索引上挂起 15 秒左右。有时我很生气并停止工作并再次尝试必须立即工作。我还没有在 GM 种子中看到这个问题(还)。顺便说一句,来自标题“Xcode Beta 6.1”......嗯?目前还没有 Xcode 6.1。
-
我的错误我已经纠正了。