1. NSString 转化为 NSData
NSData *xmlData = [ @"testdata" dataUsingEncoding:NSUTF8StringEncoding ];
2. NSData 转化为 NSString
NSString *result = [ [ NSString alloc ] initWithData:data encoding:NSUTF8StringEncoding ];
1. NSString 转化为 NSData
NSData *xmlData = [ @"testdata" dataUsingEncoding:NSUTF8StringEncoding ];
2. NSData 转化为 NSString
NSString *result = [ [ NSString alloc ] initWithData:data encoding:NSUTF8StringEncoding ];