ios – 解析SDK方法不适用于Xcode 6.3 Beta

到目前为止,我遇到了像这样的块的问题:
user.signUpInBackgroundWithBlock {
        (succeeded: Bool!,error: NSError!) -> Void in
        if error == nil {
            println("success")
        } else {
            println("\(error)");
            // Show the errorString somewhere and let the user try again.
        }
    }

当我将其添加到Xcode中时,我得到了这个:

Cannot invoke 'signUpInBackgroundWithBlock' with an argument list of type '((Bool!,NSError!) -> Void)'

当我在Xcode 6.3(非beta)中运行此代码时,它工作正常.但在测试版中它失败了,不允许我构建.任何想法,如果这将被清除或如果有我可以使用的不同实现.香港专业教育学院尝试使用signUpInBackgroundWithTarget但我只是无法正确访问错误,如果收到错误.

解决方法

确保您使用的是SDK版本1.7.1,然后从闭包中删除类型应该可以解决问题:
user.signUpInBackgroundWithBlock { (succeeded,error) -> Void in
    if error == nil {
        println("success")
    } else {
        println("\(error)");
        // Show the errorString somewhere and let the user try again.
    }
}

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...