Can be registered Nsuncaughtexceptionhandler catch exception information, will get the nsexception details to write crash log, accurate positioning error program location, there is need, can directly upload the crash information directly to the server.
-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (Nsdictionary *) launchOptions {
Nssetuncaughtexceptionhandler (&uncaughtexceptionhandler);
return YES;
}
void Uncaughtexceptionhandler (NSException *exception) {
Nsarray *arr = [exception callstacksymbols];//get current call stack information
NSString *reason = [Exception reason];//is very important, is the cause of the crash
NSString *name = [Exception name];//exception type
NSLog (@ "Exception type:%@ \ Crash reason:%@ \ n Call stack info:%@", name, Reason, arr);
}
iOS development--capturing crash information