1、NSDictionary转NSDatalet data:NSData =NSKeyedArchiver.archivedData(withRootObject:dataDic) asNSData2、NSData转NSDictionarylet dic =NSKeyedUnarchiver.unarchiveObject(with: dataas! Data)as! NSDictionary3、NSDictionary转Datalet date =try! JSONSerialization.data(withJSONObject: dic, options: .PRettyPrinted)4、Data转Dictionarylet json =try! JSONSerialization.jsonObject(with: data, options: .mutableContainers)as! Dictionary<String,String>
新闻热点
疑难解答