0

I am using the following code snippet in my AppDelegate.m to catch exceptions:

void uncaughtExceptionHandler(NSException *exception)
{
    NSLog(@"CRASH: %@", exception);
    NSLog(@"Stack Trace: %@", [exception callStackSymbols]);
}

How can I avoid this warning:

Semantic Issue: No previous prototype for function 'uncaughtExceptionHandler'?

AlexR
  • 5,514
  • 9
  • 75
  • 130

1 Answers1

1

Just declare this method in the .h file

void uncaughtExceptionHandler(NSException * exception);

or place this function over the calling function.

    void uncaughtExceptionHandler(NSException *exception){
       //your code
    }

- 

(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

            NSSetUncaughtExceptionHandler(&HandleExceptions);
//your code

return YES;

}
Ramaraj T
  • 5,184
  • 4
  • 35
  • 68