我有一个功能:
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 }@H_403_2@一致
resultArray.append(tempDict)
我有一个错误:
参数’ccomments’在调用中缺少参数
为什么?请帮助….