Tuesday, February 12, 2013

Objective-Cデバッグ用にエラー出力

デバッグ用に以下を入れる

@AppDelegate.m
void uncaughtExceptionHandler(NSException *exception) {
    NSLog(@"CRASH: %@", exception);
    NSLog(@"Stack Trace: %@", [exception callStackSymbols]);
    // Internal error reporting
}

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);
    // Override point for customization after application launch.
    return YES;
}
なんかいろいろ出てきて便利


参考

No comments:

Post a Comment