iOS NSError with global handler
- by Sebastian Dressler
I am in the beginning of programming an iOS app. Having read the Apple guides on how to deal with errors, I got the following most important points:
Exceptions are for programmers
Use NSError for the user
Now, NSError is usually passed as out-argument which can then be used inside and has to be checked by the caller. However, I'm asking myself whether it is a good idea to use a global error handler, say a singleton which wraps around NSError and could be used to trigger errors and error handling from within the called function.
Is there anything against that method or would it be a bad practice?