使用NSKeyedUnarchiver类来进行相互转换
1、NSDictionary转NSData
- vardictionaryExample:[String:AnyObject]=["user":"UserName","pass":"password","token":"0123456789","image":0]
- letdataExample:NSData=NSKeyedArchiver.archivedDataWithRootObject(dictionaryExample)
使用NSKeyedUnarchiver类来进行相互转换
1、NSDictionary转NSData
2、NSData转NSDictionary