我有这两种方法。我怎么称呼他们?
//to base 64 string
-(NSString *)getStringFromImage:(UIImage *)image{
if(image){
NSData *dataObj = UIImagePNGRepresentation(image);
return [dataObj base64Encoding];
} else {
return @"";
}
}
//Convert back
// NSData *dataObj = [NSData dataWithBase64EncodedString:beforeStringImage];
// UIImage *beforeImage = [UIImage imageWithData:dataObj];