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

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -