Hello
I developed an asp.net web service that send an image and i want to convert the received data stream to an UIImage in my iPhone
this is a sample of what i get from the web service
R0lGODlhbQCdAOYA...KsxbcSAAOw==
thank you in advance !
Hello
I developed an asp.net web service that send an image and i want to convert the received data stream to an UIImage in my iPhone
this is a sample of what i get from the web service
R0lGODlhbQCdAOYA...KsxbcSAAOw==
thank you in advance !
This is an base64 encoded string, so you need to first decode it and then put it into an NSData object. The next thing is to create an UIImage from the NSData object, this can be done like this:
NSData *myData;
UIImage *image = [UIImage imageWithData:myData];
this is what i tryed to do. I use the method dataWithBase64EncodedString: to decode and then i instanciate the UIImage with imageWithData: method but i have exc_bad_access error.
And in order to encode/decode Base64 encoded strings into NSData, see the following post. At the end there's a link to a NSData category that does Base64 encoding/decoding.