I have used this code for global level exception handling. I was suffering from a problem that any point of running app produce exception and app got crash, so I have implement application level exception handling.
Please refer this link on stack overflow may be this is useful for you.
How do you implement global iPhone Exception Handling?
Write this NSSetUncaughtExceptionHandler (&uncaughtExceptionHandler) line of code in applicationDidFixnishLaunchin Method of Appdelegate Class
-(BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:
(NSDictionary*)launchOptions
{
NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);
EDIT:
if( [[NSUserDefaults standardUserDefaults] boolForKey:@"isExceptionOccured"])
{
//call sever code here
[[NSUserDefaults standardUserDefaults] setBool:FALSE forKey:@"isExceptionOccured"];
}
//rest of your code
}
void uncaughtExceptionHandler(NSException *exception)
{
NSLog(@"Exception Got %@",[exception description]);
//do what ever you what here
//can save any `bool` so that as aaplication run on immediate next launching of crash
//could intimate any thing
EDIT:
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"isExceptionOccured"];
}