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