I have a Console application with Xcode 4.2.1 and the keyword @autolreleasepool is not compiling:
The compiler seems to be set properly for my Console application:
Do you have any suggestion? I want to understand why the new keyword doesn't work if I have Xcode 4.2.1, I know how to write the autoreleasepool using the old syntax.
UPDATE
This is code that does not compile
#include <CoreFoundation/CoreFoundation.h>
int main (int argc, const char * argv[])
{
@autoreleasepool{
NSMutableArray *array;
array = [[NSMutableArray alloc] init];
int i;
for (i = 0; i < 10; i++) {
NSNumber *newNumber =
[[NSNumber alloc] initWithInt:(i * 3)];
[array addObject:newNumber];
}
for ( i = 0; i < 10; i++) {
NSNumber *numberToPrint = [array objectAtIndex:i];
NSLog(@"The number at index %d is %@", i, numberToPrint);
}
}
return 0;
}