Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

man2manno

macrumors member
Original poster
Mar 21, 2009
55
0
Hey guys, so I have a question on which method would be better to use for a situation where I have an image stored on my server and I want to retrieve it back to a UIImage from my iphone app. I have the image uploaded and I also stored it as a BLOB type on my server.

My question is, is it better to keep the image as a BLOB and try and retrieve it from that type from my application(if so how?), or is it better just to save the link (address of the image) as a string and use NSURLDownload to retrieve the image?

Thanks a lot for the help.
 
I think it was u who also was on iphoneDevsdk, with the same question.
So read there ;)
U can get the URL, and then download it like that into ur UIImage



Code:
NSData* imageData = [[NSData alloc]initWithContentsOfURL:[NSURL URLWithString:[promotion picture_small_nl]]];
//Instead of the promotion picture_small_nl, use ur custom link with @" " or ur array like me ;)
	//NSLog(@"show imageData : %s", imageData);
	//NSLog(@"show urlstring: %@", [promotion picture_small_nl]);
	[detailViewController promotionView].image = [[UIImage alloc] initWithData:imageData];
//Here I define the imageview with the image.
or go like [self blahImageView].image = [[UIImage alloc] initWithData:imageData

good luck
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.