Error Handling Defined
When programs encounter unexpected errors, they behave unexpectedly or stop working altogether. Ideally, programmers would find and fix all bugs before programs are used, but there are some situations were programmers don’t have control of the entire situation. For instance, errors can happen when programs require resources like files or web sites that are no longer present.
The best practice in dealing with situations like this is to add error handling to a program. This means that when an error occurs, the program can recover or gracefully shutdown. NSError is the Foundation class that programmers ...