From 34682b0b087a9ced1f23a91f67167f71f304a4a8 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Tue, 2 Sep 2008 12:01:30 +0200 Subject: Switch from NS_DURING..NS_HANDLER..NS_ENDHANDLER to @try..@catch..@finally. --- MLKListenerController.m | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'MLKListenerController.m') diff --git a/MLKListenerController.m b/MLKListenerController.m index 2998ab2..9e8ddee 100644 --- a/MLKListenerController.m +++ b/MLKListenerController.m @@ -51,11 +51,11 @@ [submitButton setEnabled:NO]; - NS_DURING + @try { object = [MLKReader readFromString:input]; } - NS_HANDLER + @catch (NSException *e) { // A parsing error. Beep and let the user try again. // XXX Maybe the status line could be made to provide more information on the error. @@ -64,7 +64,6 @@ [inputField selectText:self]; return; } - NS_ENDHANDLER; [inputField setStringValue:@""]; [inputField selectText:self]; @@ -119,7 +118,7 @@ object = denullify(object); - NS_DURING + @try { int i; NSArray *results; @@ -167,7 +166,7 @@ waitUntilDone:waitp]; } } - NS_HANDLER + @catch (NSException *localException) { NSString *bare_msg = [NSString stringWithFormat: @"Caught an unhandled exception.\nName: %s\nReason: %s\n", @@ -187,7 +186,6 @@ withObject:response waitUntilDone:waitp]; } - NS_ENDHANDLER; [MLKDynamicContext popContext]; LDESTROY (newctx); -- cgit v1.2.3