Reputation: 1921
I am paring a XML and getting an image in Byte form and I have put that in a string. Now I have to draw that image.
I have tried to use various methods but no success. How can I do this?
Upvotes: 0
Views: 1626
Reputation: 3847
Try converting the string to NSData:
NSString* str= ....
NSData* data=[str dataUsingEncoding:NSUTF8StringEncoding];
Then take a look at:
UIImage *image = [[UIImage alloc] initWithData:data];
Hope this helps.
Upvotes: 3
Reputation: 26390
You can convert the byte into NSData and then you can get the image using
UIImage *image = [[UIImage alloc] initWithData:data];
OR
UIImage *image = [UIImage imageWithData:data];
Upvotes: 2