I have the following code in my program.
@try {
float result = 4 / 0; // LINE 1
} @catch (NSException *e) {
NSLog(@"Exception : %@", e);
return 0;
}
I expected an exception to be caught in LINE 1 and thrown to the @catch
block. But the execution aborts at LINE 1 showing EXC_ARITHMETIC
in console.
What am I doing wrong here? What necessary things I have to do to do exception handling?