blob: cc992ed8b23f9f58b72eafaa6b1f75d3c0a2f725 [file] [log] [blame]
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSMutableArray *array =
[NSMutableArray arrayWithObjects:@"One", @"Two", @"Three", nil];
BOOL enumerated = NO;
BOOL exceptionThrown = NO;
@try {
for (id obj in array) {
enumerated = YES;
[array removeLastObject];
}
} @catch (NSException *e) {
exceptionThrown = YES;
}
assert(enumerated == YES && exceptionThrown == YES);
[pool drain];
return 0;
}