设置<UITouch>?没有名为 Generator 的成员
Set <UITouch>? does not have a member named Generator
我发现很难修复这个错误请谁能帮助我
xcode 7 测试版 2
Set UITouch ? does not have a member named Generator
override func touchesCancelled(touches: Set<UITouch>?, withEvent event: UIEvent?) {
for obj in touches {
if let touch = obj as? UITouch {
let view = self.touchToView[touch]
self.handleControl(view, controlEvent: .TouchCancel)
self.touchToView[touch] = nil
}
}
}
}
您需要打开可选的包装 - 尝试
for obj in touches! {
// code here
}
我发现很难修复这个错误请谁能帮助我 xcode 7 测试版 2
Set UITouch ? does not have a member named Generator
override func touchesCancelled(touches: Set<UITouch>?, withEvent event: UIEvent?) {
for obj in touches {
if let touch = obj as? UITouch {
let view = self.touchToView[touch]
self.handleControl(view, controlEvent: .TouchCancel)
self.touchToView[touch] = nil
}
}
}
}
您需要打开可选的包装 - 尝试
for obj in touches! {
// code here
}