diff options
author | Matthias Andreas Benkard <matthias@benkard.de> | 2008-09-02 12:01:30 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <matthias@benkard.de> | 2008-09-02 12:01:30 +0200 |
commit | 34682b0b087a9ced1f23a91f67167f71f304a4a8 (patch) | |
tree | 70ef9e0a697a3fdfa194ce4819d55ce2b36fc8af /MLKArray.m | |
parent | 84597fcf74fc74672fe664456e62ec6be5f2b066 (diff) |
Switch from NS_DURING..NS_HANDLER..NS_ENDHANDLER to @try..@catch..@finally.
Diffstat (limited to 'MLKArray.m')
-rw-r--r-- | MLKArray.m | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -23,6 +23,7 @@ #import <Foundation/NSArray.h> #import <Foundation/NSEnumerator.h> +#import <Foundation/NSException.h> #include <stdio.h> #include <search.h> @@ -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 |