Ignore:
Timestamp:
03/05/08 03:01:09 (12 years ago)
Author:
Nicholas Riley
Message:

Use @try/@catch/@finally rather than macro-based exceptions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ICeCoffEE/ICeCoffEE/ICeCoffEE.m

    r435 r436  
    153153    Handle h = NULL;
    154154   
    155     NS_DURING
     155    @try {
    156156        h = NewHandle(len);
    157157        if (h == NULL)
     
    174174        err = ICCF_DoURLAction(ICCF_GetInst(), hint, *h, selStart, selEnd, action);
    175175        ICCF_OSErrCAssert(err, @"ICCF_DoURLAction");
    176        
    177     NS_HANDLER
     176    } @finally {
    178177        DisposeHandle(h);
    179178        [urlString release];
    180         [localException raise];
    181     NS_ENDHANDLER
    182        
    183     DisposeHandle(h);
    184     [urlString release];
     179    }
    185180
    186181    return (err == noErr);
     
    213208    NSColor *insertionPointColor = [self insertionPointColor];
    214209
    215     NS_DURING
    216 
     210    @try {
    217211        NSString *s = [[self textStorage] string]; // according to the class documentation, sending 'string' is guaranteed to be O(1)
    218212        unsigned length = [s length];
     
    260254            }
    261255        }
    262 
    263     NS_HANDLER
    264         ICCF_HandleException(localException, triggeringEvent);
    265     NS_ENDHANDLER
     256    } @catch (NSException *e) {
     257        ICCF_HandleException(e, triggeringEvent);
     258    }
    266259
    267260    ICCF_StopIC();
Note: See TracChangeset for help on using the changeset viewer.