NSDictionary to NSData and NSData to NSDictionary in Swift
问题 I am not sure if I am using the dictionary or the data object or both incorrectly. I m trying to get used to the switch to swift but I'm having a little trouble. var dictionaryExample : [String:AnyObject] = ["user":"UserName", "pass":"password", "token":"0123456789", "image":0] // image should be either NSData or empty let dataExample : NSData = dictionaryExample as NSData I need the NSDictionary to encode to an NSData object as well as taking that NSData object and decode it into a