将用户注册到iOS上的解析服务器时出错

时间:2016-02-27 23:48:41

标签: ios parse-platform

当应用尝试注册用户时,它无法正常工作并返回错误:

  

错误域= NSCocoaErrorDomain代码= 3840" JSON文本不是以数组或对象开头,而是选项允许未设置片段。" UserInfo = {NSDebugDescription = JSON文本不以数组或对象开头,并且选项允许未设置片段。}"。

我已完成研究,无法找到与Parse相关的任何内容。

Parse SDK: 1.12.0

代码:

user.signUpInBackgroundWithBlock { (succeeded: Bool, error: NSError?) -> Void in
        if let error = error {
            print(error.description)
        } else {

            self.performSegueWithIdentifier("signup_signin", sender: nil)
        }
    }

JSON of what gets returned when using the REST API

1 个答案:

答案 0 :(得分:0)

也许this会有所帮助

除非您将选项NSJSONReadingAllowFragments传递给[NSJSONSerialization JSONObjectWithData:options:error:],否则来自服务器的响应必须是有效的JSON,顶级容器是数组或字典。