Custom Exception Handling on Object C

How to do custom exception handling on objective C ... Any useful tutorial, please help me ...

Sincerely.

0
source share
3 answers

In cocoa, you can understand why Exception is Happening and you need to solve the situation more than handle it. Any way you can use

@try { //Your code } @catch(NSException* e) // or subclass of NSException { } 

see also

0
source

try / catch should really be avoided in all but the most extreme cases. Apple has an excellent API for handling situations where known errors will occur, usually including the NSError parameter in a message call or delegate callback. try / catch is not a common error handling mechanism, but it is used in extreme situations, when you usually interrupt your application. I would advise you to rethink the design of your application and use standard error handling tools before proceeding with try / catch.

+4
source

To familiarize yourself with exception handling: try this tutorial Handling Exceptions in Iphone

+1
source

Source: https://habr.com/ru/post/890468/


All Articles