when I do the following the resulting image is null
NSLog(@"string (%@) to base64NSData",object);
NSData *base64Data = [[object dataUsingEncoding:NSUTF8StringEncoding] base64EncodedDataWithOptions:0];
NSLog(@"NSData (%@) to UIImage",base64Data);
UIImage *image = [UIImage imageWithData:base64Data];
NSLog(@"my image is: %@",image);
How might I do this well?
Reason
I need to save an image from iOS to the Google blobstore. I need to include some metadata with the image. When I encode the string as base64 it does not work.
This is loosely a follow up to AFHTTPRequestOperationManager post multi-part request not working
Here is the code for generating image from NSString..
Implement this method....
Call this method like...
I hope it work for you..
Here is UIImage category I used to fix my problem
http://hasseg.org/blog/post/692/use-unicode-emoji-as-icons-in-native-ios-apps/
You can modify method to pass extra parameters like font, color, backgroundColor as follows :