通过RunLoop避免一次闪退

import

import "AppDelegate.h"

void CrashHandlerExceptionHandler(NSException *exception) {

NSLog(@"%@",[exception callStackSymbols]);

CFRunLoopRef runLoop = CFRunLoopGetCurrent();

NSArray *allModes = CFBridgingRelease(CFRunLoopCopyAllModes(runLoop));

while (1)

{

    for (NSString *mode in allModes) {

        CFRunLoopRunInMode((CFStringRef)mode, 0.0001, false);

    }

}

}

int main(int argc, char * argv[]) {

@autoreleasepool {

    NSSetUncaughtExceptionHandler (&CrashHandlerExceptionHandler);

    return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));

}

你可能感兴趣的:(通过RunLoop避免一次闪退)