解析SDK方法不适用于Xcode 6.3 Beta [英] Parse SDK methods not working in Xcode 6.3 Beta

查看:116
本文介绍了解析SDK方法不适用于Xcode 6.3 Beta的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我遇到了像这样的问题:

So far I am having issues with blocks like this:

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中时,我得到:

When I add this into Xcode I get this:

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

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

When I run this code in Xcode 6.3 (non beta) it works fine. But in the Beta it fails and wont allow me to build. Any ideas if this will be cleared up or if there is a different implementation that I could use. Ive tried using just the signUpInBackgroundWithTarget but Im just not able to access the error correctly if one is received.

推荐答案

请确保你是使用SDK版本1.7.1,然后从闭包中删除类型应该可以做到这一点:

be sure you are using SDK version 1.7.1, then removing the types from your closure should do the trick:

user.signUpInBackgroundWithBlock { (succeeded, error) -> Void in
    if error == nil {
        println("success")
    } else {
        println("\(error)");
        // Show the errorString somewhere and let the user try again.
    }
}

这篇关于解析SDK方法不适用于Xcode 6.3 Beta的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆