Avoid Mistakes in Error Handling

Opportunities for errors abound; use common sense in figuring out which ones you should spend work time on. For example, don’t panic over handling a missing bundle resource in your code. If you included it in your project, it’s supposed to be there; if it’s not, look for a bug in your program. If it’s really not there, the user has big problems, and you probably won’t be able to do anything to avert the oncoming catastrophe.

Having said that, here are two big potential pitfalls you do have to pay attention to:

check.png Your app goes out to load something off the Internet, and (for a variety of reasons) the item isn’t there, or the app can’t get to it. You especially need to pay attention to Internet availability and what you’re going to do when the Internet isn’t available.

check.png A geocoder may fail for any number of reasons. For example, the service may be down, there may not be a street address at a certain GPS coordinate, or the user may access the data before the geocoder has returned.

Get iPad Application Development For Dummies, 3rd Edition 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.