相关疑难解决方法(0)

Alamofire字符0周围的值无效

Alamofire.request(.GET, "url").authenticate(user: "", password: "").responseJSON() {
    (request, response, json, error) in
    println(error)
    println(json)

}
Run Code Online (Sandbox Code Playgroud)

这是我对Alamofire的要求,因为某个时候有一定的要求,但有时我得到:

Optional(Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (Invalid value around character 0.) UserInfo=0x78e74b80 {NSDebugDescription=Invalid value around character 0.})
Run Code Online (Sandbox Code Playgroud)

我已经读过这可能是由于JSON无效,但是响应是一个静态json字符串,我在JSON验证器中验证为有效.它包含åäö字符和一些HTML.

为什么我有时会收到此错误?

ios swift alamofire

87
推荐指数
5
解决办法
7万
查看次数

标签 统计

alamofire ×1

ios ×1

swift ×1