I am facing some problems with setting up the uncaught exception handler. Here's what I am doing :
In the app delegate.h:
- (void) uncaughtExceptionHandler(NSException *exception);
In the app delegate.m:
void uncaughtExceptionHandler(NSException *exception) {
[FlurryAPI logError:@"Uncaught" message:@"Crash!" exception:exception];
}
- (void)applicationDidFinishLaunching:(UIApplication *)application {
NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler); // error line
[FlurryAPI startSession:@"API_KEY"];
....
}
I am getting the following error:
Use of Undeclared Identifier "uncaughtExceptionHandler"
Try removing the leading "-" from the method declaration in the app delegate.h. This appears to be a lower-level, C-like function and not an Object-C object-oriented instance method (which is what "-" means in method declaration).
It should look like this:
void uncaughtExceptionHandler(NSException *exception);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With