iOS NSError with global handler

Posted by Sebastian Dressler on Programmers See other posts from Programmers or by Sebastian Dressler
Published on 2014-08-21T08:10:30Z Indexed on 2014/08/21 10:29 UTC
Read the original article Hit count: 169

Filed under:
|
|

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?

© Programmers or respective owner

Related posts about ios

Related posts about objective-c