- (void)test { NSMutableString *str = [@"01234" mutableCopy]; /* 常に実行される */ @try { // 範囲外の例外(NSRangeException)を起こす [str replaceCharactersInRange:NSMakeRange(0, 6) withString:@"x"]; NSLog(@"%@", str); // 01234 (リプレースされないでそのまま) } /* 例外が起きると実行される */ @catch (NSException *exception) { NSLog(@"[ERROR]\nstr[%@]\nexception[%@]", str, exception); /* 本来の例外処理に投げる (@throwしなければクラッシュされない。@finallyが実行されstrは元の@"01