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. --- MLKArray.m | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'MLKArray.m') diff --git a/MLKArray.m b/MLKArray.m index 11c7889..fb7953a 100644 --- a/MLKArray.m +++ b/MLKArray.m @@ -23,6 +23,7 @@ #import #import +#import #include #include @@ -241,19 +242,17 @@ static int equalp (const void *x, const void *y) -(id) objectAtIndex:(NSUInteger)index { - NS_DURING + @try { - NS_VALUERETURN (nullify([self idAtIndex:index]), id); + return nullify ([self idAtIndex:index]); } - NS_HANDLER + @catch (NSException *e) { - if ([[localException name] isEqualToString:@"NSRangeException"]) + if ([[e name] isEqualToString:NSRangeException]) return nil; else - [localException raise]; - return nil; + @throw; } - NS_ENDHANDLER; } -(void) insertObject:(id)anObject atIndex:(NSUInteger)index -- cgit v1.2.3