How to handle SIGKILL, SIGABRT, Signal-0 exceptions through exception handling in iPhone programming

I have to catch the exception when SIGKILL , SIGABRT , Signal-0 exceptions occur.

Please imagine how to handle the above signals using exception handling.

Can you offer me some sample code for this?

Thanks in advance.

+6
source share
2 answers

developers with java and C # backgrounds must work to handle exceptions in iOS. Apple has a really good API for resolving known bugs, but the program should be excluded for free (which I know is complicated). Sigabrt usually occurs when u returns an object, and SIGKILL usually occurs when systems kill your application due to out of memory. Therefore, I suggest you read the Apple memory management guide . Alternatively, you can go through this link and . . Apple has a class defined for exception handling - NSException .

also TRY TO IMPROVE YOUR RECEPTION.

Good luck.

0
source

You can catch most of the unhandled exceptions by registering an NSUncaughtExceptionHandler in your application delta.

Similarly, you can capture most of the signals using sigaction or signal

As you can see in both links above, you cannot catch signals like SIGKILL and SIGSTOP.

try to analyze your code for any possible reasons causing these signals.

+2
source

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


All Articles