15.NSData与String相互转换
2016-04-11 本文已影响81人
noonez
String转NSData
let data = string.dataUsingEncoding(NSUTF8StringEncoding)
NSData转String
let string = String(data: data, encoding: NSUTF8StringEncoding)
String转NSData
let data = string.dataUsingEncoding(NSUTF8StringEncoding)
NSData转String
let string = String(data: data, encoding: NSUTF8StringEncoding)