you can define a C method.
// first
void uncaughtExceptionHandler(NSException *exception) {
NSArray *stackArray = [exception callStackSymbols];
NSString *reason = [exception reason];
NSString *name = [exception name];
// Get exception infomation.
NSString *exceptionInfo = [NSString stringWithFormat:@"Exception reason:
%@\nException name:%@\nException stack:%@",name, reason, stackArray];
/**
send email
**/
}
//second set this method like this in appdelegate.m
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//regist method
NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);
return YES;
}
감사합니다.하지만 프레임 워크/coocapods를 사용하고 싶지 않습니다. –