iPhone NSMutableArray loading background image from url -


i have nsmutablearray stores url image. , nsmutablearray called userpic. server prints out url: not json or anything, url.

i can see in output in xcode shows url, how url in userpic background? im trying addsubview image background.

if unclear, sorry that. let me know.

please try use one.and think url @ index 0 of array.

nsurl *imgurl = [nsurl urlwithstring:[userpic objectatindex:0]]; // put particular index image url in array... nsdata *imgdata = [[nsdata alloc]initwithcontentsofurl:imgurl]; uiimage *img = [uiimage imagewithdata: imgdata];  [newview setbackgroundcolor:[uicolor colorwithpatternimage:img]] 

Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -