0
我正在使用Alamofire檢索URL圖像列表。響應是在JSON中我已經使用SwiftyJSON來解析和打印每個元素。我想要將URL添加到URL數組中。下面是我用將SwiftyJSON中的元素添加到Swift中的URL數組中
var newArray = [URL(string: "http://www.tummyvision.com/users/uploads/[email protected]/photos/4.jpg")]
Alamofire.request("http://www.tummyvision.com/users/login/get-images.php", parameters: parameters).responseData { response in
let json = JSON(data: response.result.value!)
for i in 0..<json.count
{
print(json[i]) // prints the correct url
self.urlArray.append(json[i])
}
}
的代碼,但它給我以下錯誤: