I'm displaying a few images that are being downloaded over a network connection on a UITableView. Loading these images is extremely slow. Are there any performance tricks I can use?
What part is slow -- the network, or the drawing?
If it's the network, unless you control the source of the data (e.g. maybe the Web server hosting these images), there's not much you can do, unless you can switch servers somehow (say, from a small Web site to using Amazon's cloud technology).
If it's the drawing, you can use Core Graphics for drawing your views, if you're just using UIImage
/UIImageViews
, and you're certain that's the bottleneck, as it's a bit more work. You should also be (at the very least) caching the data you're downloading.
Edit: Have you profiled your code to see what's slow? That's always the first step in optimizing anything; measure, then optimize. If you're parsing XML, that could very well be the bottleneck, but there's no way to tell until you profile. As you can see, it's hard to tell someone how to speed up performance without knowing what the problem is first.
If you are displaying images from the network, they should be cached for any sort of reasonable performance. Consider the built-in App Store application: it only loads images for table cells that are on the screen, but after an image is loaded the application stores the image for later.
Also, parsing XML on the iPhone is going to be slow--especially with binary data embedded. You should serve images to your app as PNG/JPEG over HTTP for best results.