如下代码获取一个String?的结果 let s = NSString(data: data, encoding: encoding) return s as? String 转载于:https://www.cnblogs.com/ilovewindy/p/4549425.html