大佬教程收集整理的这篇文章主要介绍了nsarray – Swift中的元组数组,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
func parseJSON3(inputData: NSData) -> NSArray { var tempDict: (id:Int,ccomments:Int,post_date:string,post_title:string,url:string) = (id: 0,ccomments: 0,post_date: "null",post_title: "null",url: "null") var resultArray: (id:Int,url:string)[] = [] var error: NSError? var jsonDictionary: NSDictionary = NSJSONserialization.JSONObjectWithData(inputData,options: NSJSONReadingOptions.MutableContainers,error: &error) as NSDictionary var firstArray = jsonDictionary.objectForKey("LOCATIOns") as NSArray for Dict in firstArray { tempDict.id = Dict.valueForKey("ID") as Int tempDict.ccomments = Dict.valueForKey("ccomments") as Int tempDict.post_date = Dict.valueForKey("post_date") as String tempDict.post_title = Dict.valueForKey("post_title") as String tempDict.url = Dict.valueForKey("url") as String resultArray.append(tempDict) } return resultArray }
一致
resultArray.append(tempDict)
参数’ccomments’在调用中缺少参数
为什么?请帮助….
以上是大佬教程为你收集整理的nsarray – Swift中的元组数组全部内容,希望文章能够帮你解决nsarray – Swift中的元组数组所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。