Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift 仅在实际设备上,字符0周围的Alamofire值无效_Swift_Alamofire - Fatal编程技术网

Swift 仅在实际设备上,字符0周围的Alamofire值无效

Swift 仅在实际设备上,字符0周围的Alamofire值无效,swift,alamofire,Swift,Alamofire,Node.js Swift 2.1 router.get('/mp3', function(req, res, next) { var lists = [ { title : "Conversation 01", desc : "xxxx" , url : "xxxx" }, { title : "Conversation 02", desc : "xxxx" , url : "xxxx" } ]; res.json(lists); }); 错误域=NSCOCA

Node.js

Swift 2.1

router.get('/mp3', function(req, res, next) {

var lists = [

{
    title : "Conversation 01", desc : "xxxx" , url : "xxxx"


},
{
    title : "Conversation 02", desc : "xxxx" , url : "xxxx"

}



];
res.json(lists);
});
错误域=NSCOCAERRORDOMAIN Code=3840“周围的值无效 字符0。“UserInfo={NSDebugDescription=周围的值无效。” 字符0

该错误仅在实际设备上返回! iOS模拟器没有问题

通过将参数设置为“nil”,问题得到了解决


失败案例中的
response.data
是什么?失败案例中的
response.data
是什么?
Alamofire.request(.GET, "https://myserver/mp3", parameters: ["foo": "bar"])
.responseJSON { response in
print(response.request) // original URL request
print(response.response) // URL response
print(response.data) // server data
print(response.result) // result of response serialization

         if let JSON = response.result.value {
             print("JSON: \(JSON)")
         }
     }