Why don't use try..catch?


Dear community!

In chapter two there is one paragraph I can"t fully agree with. The paragraph is this one:

I came from C# Programming and I use try…catch blocks very often. First and foremost for exceptions I can’t influence. For example:

[ul]A file is not readable or not at the expected path.
The Webservice which is used is offline or sends malformed data.
The database server is offline.
The network connectionn is not available.[/ul]

These errors obviously can’t be handled at compile time and I think try…catch blocks are perfect for these situations. If i were not using try…catch i have to check the existance of a file every time i use it. Isn’t that a poorer approach insted of writing code thas isn’t aware of such an error an provides rescue code that is executed then the file isn’t there? So my code is faster as it doesn’t check the existence of that file.

I am very interested in your opinion.

Best regards


In all of those circumstances, an NSError object will be returned describing the error, which you will handle depending on the information held in the NSError object.