diff -r 000000000000 -r 256370e8935a With.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/With.h Sun May 03 10:13:31 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