I decided to beef up my table view a little bit by incorporating thumbnail images into the main table view, and then a larger (170x170) image in the detail view (similar to our implementation in Homepwner.)
Everything works fine (except for the price in the detail view, but I’m not worrying about that part as it seems like a fairly simple issue to fix later.)
My implementation extracts the image URL from the XML document (at first, it’s the 55x55 image), downloads the image and includes a UIImage as part of an object called “Song.” (which includes a method called setAlbumArt - but NOT @synthesized - that accepts the URL, downloads the image, does the conversion, and stores/retains the resulting UIImage.) When creating the table at first, every Song object also stores the URL to the 170x170 image.
The beauty of this approach is that later, once the table is fully loaded, if the user selects a row to show a song detail, the program can check to see if the URL field has data in it. If it does, then it can download the 170x170 image, create a new UIImage, and store it in the AlbumArt field, overwriting the original 55x55 image.
That way, I don’t need to waste a lot of time downloading 10 170x170 images and creating them at first.
It is still taking quite a while to download and create 10 55x55 UIImage objects and store them in the Song object to which they belong; so it dawned upon me that perhaps I could create a UIPopover or something which informs the user that songs are being loaded and parsed. Then it dawned on me that I could, theoretically, update a UILabel in the popover with the entry title currently being worked on.
And that’s where I hit the wall.
Despite sending a setText message to the appropriate UILabel object, the popover just wouldn’t update. I tried dismissing and re-presenting. I also tried dismissing, releasing, re-allocating, and re-presenting. Nothing worked.
Then it dawned on me that I might be thinking too much; and perhaps, instead of a popover, just send a [[self tableView] reloadData]; whenever a song is encountered in the xml data. The idea being as songs are added to the array of songs, then the table could update itself, line by line, so the user sees the list growing.
That didn’t work either.
It seems that the [parser parse]; line blocks operation until parsing is complete. Am I correct in understanding that it also blocks UI updates with [[self tableView] reloadData]; as well?
Or am I missing something else?