NSString 转换成NSData 对象
NSData 转换成NSString对象NSData* xmlData = [@"testdata" dataUsingEncoding:NSUTF8StringEncoding];
NSData * data; NSString *result = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSData 转换成char*
char* 转换成NSData对象NSData *data; char *test=[data bytes];
byte* data = malloc(sizeof(byte)*16); NSData *content=[NSData dataWithBytes:data length:16];