Friday, 29 May 2015

Throw an exception in Obj C

I've just been implementing HockeyApp and GetSentry crash reporting in one of our iOS native apps, and this handy piece of code came in useful for testing what happens when an exception is thrown.

        NSException* myException = [NSException
                                    reason:@"Just testing"
        @throw myException;