func nsdataToJSON(data: NSData) -> AnyObject? {
do {
return try JSONSerialization.jsonObject(with: data as Data, options: .mutableContainers) as AnyObject
} catch {
print(error)
}
return nil
}
func nsdataToJSON(data: NSData) -> AnyObject? {
do {
return try JSONSerialization.jsonObject(with: data as Data, options: .mutableContainers) as AnyObject
} catch {
print(error)
}
return nil
}
本文标题:swift4.0 data转json
本文链接:https://www.haomeiwen.com/subject/wsoyxftx.html
网友评论