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