func arrayToJson(arr:NSArray) -> String {
let jsonData: NSData = try! NSJSONSerialization.dataWithJSONObject(arr, options: NSJSONWritingOptions.PrettyPrinted)
let str:String = String(data: jsonData, encoding: NSUTF8StringEncoding)!
return str
}
时间: 2024-10-13 14:17:54