开发者

how to get the image from xml file?

开发者 https://www.devze.com 2023-02-15 13:01 出处:网络
I have xml file in that i have <Image>/9j/4AAQSkZJRgABAgEAYABgAAD/7Rgu开发者_如何学JAVAUGhvdG9zaG9wIDMuMAA4QklNA+0KUmVzb2x1dGlvbgAA</Image>

I have xml file in that i have

<Image>/9j/4AAQSkZJRgABAgEAYABgAAD/7Rgu开发者_如何学JAVAUGhvdG9zaG9wIDMuMAA4QklNA+0KUmVzb2x1dGlvbgAA</Image>

I want image on my simulator.. Is there any way to get it? it is in byte code but i want byte code into image. Please give me reply with solution.


You need to convert that nsstring into base 64 encoding string and then

UIImage *image = [UIImage imageWithData:[NSData dataWithBase64EncodedString:64encodedstr]];


You can use

UIImage *img = [[UIImage alloc] initWithData:data];

or

UIImage *img = [UIImage imageWithData:data];
0

精彩评论

暂无评论...
验证码 换一张
取 消