Avoid Mistakes in Error Handling (IPhone Application Development)

A lot of opportunities for errors are out there; use common sense in figuring out which ones you should spend work time on. For example, don’t panic over handling a missing directory in your code. On the iPhone, it’s supposed to be there; if it’s not, then look for a bug in your program. If it’s really not there, then the user has big problems, and you probably won’t be able to do anything to avert the oncoming hassle.
There are, however, some potential pitfalls you do have to pay attention to, such as these two big ones:
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.
An object can’t initialize itself (for a similar range of perverse reasons).
tmp139-2_thumb
When, not if, those things happen, your code and your user interface must be able to deal with the error.

Next post:

Previous post: