xml - iPhone RSS Reader, get image from rss feed -


i've problem. i've app download rss feed website. works fine, want set image in table view articles appear. how can image rss feed? need code. title, description i've done perfectly, i'm not able recover image.

p.s. : sorry english, i'm italian :)

ok, presume have url of image. can this:

//normal text setting code //normal text setting code
nsstring *imageurlstring = [rssfeed objectforkey:@img"]; nsurl *imageurl = [nsurl urlwithstring:imageurlstring]; nsdata *imagedata = [nsdata datawithcontentsofurl:imageurl]; cell.imageview.image = [uiimage imagewithdata:imagedata];

that quick , filthy method. it's running in ui thread etc, it's going terrible user experience. can fiddle performance on own terms, i'd suggest 1 of following:

  1. load data asynchronously , fill data becomes available
  2. load of data in secondary thread, show loading spinner

for both of above, put images nsarray , call them doing cell.imageview.image = [myimagearray objectatindex:indexpath.row];

the best solution (and complicated) though called 'lazy loading'.

if want lazy loading (the way facebook , twitter it) should check out: lazytableimages.

happy coding, zane


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -