【发布时间】:2014-07-03 19:39:36
【问题描述】:
当我实现这个方法时,我的 SourceKitService 被终止了:
override func touchesBegan(touches: NSSet!, withEvent event: UIEvent!)
如果我删除 ! ,它可以工作。 但是后来我的代码当然出错了。 完整代码:
override func touchesBegan(touches: NSSet!, withEvent event: UIEvent!) {
for touch: AnyObject in touches {
let location = touch.locationInNode(self)
if nodeAtPoint(location).name == "plane" {
println("plane touched")
}
}
}
【问题讨论】:
-
这个问题似乎离题了,因为它是关于测试版软件中的一个错误。
-
所以我们不能在 xcode 6 中实现 func touchesBegan ?
-
@user3722523 可以,但在修复错误之前不进行语法高亮显示