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
Post a Comment