diff -r 000000000000 -r 66b870428f85 With.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/With.h Sat May 31 11:26:17 2008 -0700 @@ -0,0 +1,21 @@ +// +// With.h +// MYUtilities +// +// Copyright 2008 Jens Alfke. All rights reserved. +// + +#import + + +#define WITH(OBJ) id __with=[OBJ beginWith]; @try + +#define ENDWITH @finally{[__with endWith];} +#define CATCHWITH @catch(NSException *x){id w=__with; __with=nil; _catchWith(w,x);} @finally{[__with endWith];} + +void _catchWith( id with, NSException *x ); + +@interface NSAutoreleasePool (With) ++ (NSAutoreleasePool*) beginWith; +- (void) endWith; +@end \ No newline at end of file