相关疑难解决方法(0)

'Set <NSObject>'没有名为'anyObject'的成员. - Xcode 6.3

我正在检查是否已选择元素.

func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent)
{
    // First, see if the game is in a paused state
    if !gamePaused
    {
        // Declare the touched symbol and its location on the screen
        let touch = touches.anyObject! as? UITouch
        let location = touch.locationInNode(symbolsLayer)
Run Code Online (Sandbox Code Playgroud)

这个以前在Xcode 6.2中编译得很好但是有了6.3更新,"let touch = touches.anyObject!as?UITouch"这一行引发了错误:

'Set'没有名为'anyObject'的成员

我已经阅读了许多类似的问题,但我似乎无法理解"要使用价值,你需要首先解开".特别是因为答案似乎集中在通知上.

非常感谢.w ^

xcode set nsobject ios swift

23
推荐指数
1
解决办法
1万
查看次数

标签 统计

ios ×1

nsobject ×1

set ×1

swift ×1

xcode ×1