综合技术

Application detection broke during load / last time it was run?

微信扫一扫,分享到朋友圈

Application detection broke during load / last time it was run?
0

I would like for my app to reset to standard settings if it crashed during startup. Preferably also if it crashed last time it was run.

EDIT: Crittercism has a crittercismDidCrashOnLastLoad method, but it only handles the case of crashing during load. It didn’t work properly in the version of the library I used, but this has since been fixed.

Suggestions?

Make 2 functions in your AppDelegate.m
file:

void HandleException(NSException *exception) {
    NSLog(@"App crashing with exception: %@", exception);
    //Save somewhere that your app has crashed.
}

void HandleSignal(int signal) {
    NSLog(@"We received a signal: %d", signal);
    //Save somewhere that your app has crashed.
}

Then in your -(BOOL)application:didFinishLaunchingWithOptions
before anything else put:

NSSetUncaughtExceptionHandler(&HandleException);

struct sigaction signalAction;
memset(&signalAction, 0, sizeof(signalAction));
signalAction.sa_handler = &HandleSignal;

sigaction(SIGABRT, &signalAction, NULL);
sigaction(SIGILL, &signalAction, NULL);
sigaction(SIGBUS, &signalAction, NULL);
阅读原文...

Hello, buddy!

Missing data hinder replication of artificial intelligence studies

上一篇

No equal margins left and right, why is it?

下一篇

您也可能喜欢

评论已经被关闭。

插入图片
Application detection broke during load / last time it was run?

长按储存图像,分享给朋友