I'm trying to develop an AQGridView
in iPhone. I downloaded the .zip file of AQGridView
from GitHub social coding site. The example application of AQGridView
(ImageDemo, SpringBoard, ExpanderDemo) can't be run in Xcode 4 and iOS SDK 4.3.
At compile time the error is showing:
"AlanQuatermain-AQGridView-4072978/Examples/ImageDemo/main.m:14:5: error:
unexpected '@' in program [3]"
The error indicator is shown at main()
. The code of main()
is bellow:
int main(int argc, char *argv[]) {
int retVal;
@autoreleasepool {
retVal = UIApplicationMain(argc, argv, nil, nil);
}
return retVal;
}
My questions are:
@autoreleasepool{.....}
is?@autoreleasepool was introduced in LLVM 3.0,the compiler available in Xcode 4.2. Since you’re using Xcode 3.2.6, you have LLVM 1.6 and GCC, neither of which recognises that directive.
You can change the code to use NSAutoreleasePool instead of @autoreleasepool so that it builds with Xcode 3.2.6. For example, replace:
@autoreleasepool { … } with:
NSAutoreleasePool *pool = [NSAutoreleasePool new]; … [pool drain];