NSDictionary 到 NSData

NSDictionary *myDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:@"value1", @"key1", @"value2", @"key2", nil];  
NSData *myData = [NSKeyedArchiver archivedDataWithRootObject:myDictionary];

保留路径:

NSDictionary *myDictionary = (NSDictionary*) [NSKeyedUnarchiver unarchiveObjectWithData:myData];