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

objective c - Can't build GCM with Protobuf in Xcode -

ember.js - EmberJS Model find not up-to-date with underlying store -

javascript - jQuery iScroll clickable list elements while retaining scroll? -