NSData轉換成NSString:
NSString *msg = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSString轉換成NSData
NSData* xmlData
= [str dataUsingEncoding:NSUTF8StringEncoding];
UIImage轉換成NSString
NSData *data = UIImageJPEGRepresentation(img, 1.0);
NSString *pictureDataString = [data base64Encoding];
NSString轉換成UIImage
NSData *aData = [NSData dataWithBase64EncodedString:str];
UIImage *image = [UIImage imageWithData:aData];