1

Here is my uncaught exception handler in app delegate and I am registering it.

void myHandler(NSException * exception)
{
    NSError *error;
    NSString *stringToWrite = [[NSString alloc]initWithFormat:@"Name:%@ Reason:%@ CallStackSymbols:%@",exception.name,exception.reason,exception.callStackSymbols];
    NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject] stringByAppendingPathComponent:@"crashlog.txt"];
    [stringToWrite writeToFile:filePath atomically:YES encoding:NSUTF8StringEncoding error:&error];
}

- (BOOL) application : (UIApplication*) application didFinishLaunchingWithOptions : (NSDictionary*) launchOptions {
 NSSetUncaughtExceptionHandler(&myHandler);
}

I have enabled itunesfile sharing to see the crash log

after the crash in release build .. I am not able to find the file in iTunes whereas I am able to find it in debug build.

(I had array index out of bound error... to test it)

Can somebody explain me what's happening

Shankar Naik
  • 401
  • 5
  • 16

0 Answers0