diff -r 000000000000 -r 5cab3034d3a1 With.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/With.h Wed Sep 02 08:41:25 2009 -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