http://code.google.com/p/google-toolbox-for-mac에서 GTMStackTrace를 사용하고 있습니다.NSSetUncaughtExceptionHandler가 iPhone에서 모든 오류를 catch하지 않습니다.
응용 프로그램이 고장 났을 때 최종 사용자에게 오류를 보내도록 테스트하는 방법이 필요합니다. 내 웹 사이트로 데이터를 보내는 방법을 알고 있지만 문제는 처리되지 않은 모든 오류를 잡는 방법입니다.
는이 코드가 있습니다
void exceptionHandler(NSException *exception) {
NSLog(@"%@", [exception reason]);
NSLog(@"%@", [exception userInfo]);
NSLog(@"%@", GTMStackTraceFromException(exception));
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:NSLocalizedString(@"Error unexpected",@"Info: Can't save record")
message:GTMStackTraceFromException(exception) delegate:nil
cancelButtonTitle:NSLocalizedString(@"Ok",@"Button: Ok") otherButtonTitles:nil];
[alert show];
[alert release];
}
int main(int argc, char *argv[]) {
//For crash report..
NSSetUncaughtExceptionHandler(&exceptionHandler);
//Normal code...
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
그러나, 일이 등 나쁜 릴리스, 나쁜 ACCES처럼, 많은 오류를 잡았하지, 그리고 앱이 사라집니다. 나는 2 가지 이슈를 가지고 있는데, 왜 그런 일이 일어나지 않았으며 최종 사용자는 무엇을 말해야할지에 대해 알지 못합니다.
그래서, 내가 얼마나 최종 사용자의 간단한 때문에 모든 성가신 오류가 나에게 충돌 보고서를 보내 (예를 릴리스의 두 번 같은 VAR 잡을되지 않음)?
는 오류 라인 전체 스택 추적을 얻을 수 있습니까? – mamcx
실제로 UIAlertView를 표시 할 수 있습니까? 나는 할 수 없다. 어떤 충고? – Mark