Chapter 3. Working the URL Loading System

In This Chapter

  • Understanding the URL loading system

  • Downloading data asynchronously

  • Using delegation in displaying data

  • Displaying the sights (as annotations) on a map

In the grand scheme of things, downloading only a small bit of data from the Internet has no impact on your app's performance, but when that begins to increase, you're going to run into trouble. That's because right now when the downloading is taking place, everything else stops. You can imagine, then, how annoyed the users will be when you start downloading lots of images and text for the sights in the RoadTrip application. Users may even have to get themselves another iPhone to keep themselves amused while waiting for the data to finish downloading.

Again, this isn't an issue in small simple apps, but it's something you must address if you're creating industrial-strength applications. By this I mean not just business applications, but anything that delivers a significant amount of content to the user.

Interestingly enough, the solution to the problem, the URL loading system, involves the use of delegation as well, as do many of the other synchronous processes you have and will use (the XML parser you used in Book V, for example).

Finally, when you do get the sights loaded, you're going to want to display them on the map. This chapter goes into more detail about how to do that. I also extend the map discussion from the last book and show you how to create model objects that can ...

Get iPhone® Application Development All-In-One For Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.