在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
原创Blog,转载请注明出处 使用NSKeyedUnarchiver类来进行相互转换 1、NSDictionary转NSData var dictionaryExample : [String:AnyObject] = ["user":"UserName", "pass":"password", "token":"0123456789", "image":0] let dataExample : NSData = NSKeyedArchiver.archivedDataWithRootObject(dictionaryExample) 2、NSData转NSDictionary let dictionary:NSDictionary = NSKeyedUnarchiver.unarchiveObjectWithData(dataExample)! as NSDictionary |
请发表评论