问题
I am trying to incorporate CorePlot into my project. I finally manages to get my header files recognized but i keep getting the following error in my main.m.
"Expected expression before '@' token"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([ProjectFiveAppDelegate class]));
}
}
回答1:
The @autoreleasepool syntax was introduced fairly recently, you probably need to install Xcode 4.2. Another possibility is that your compiler is set to GCC which AFAIK doesn't support those newer Objective-C changes.
If this is the only place where newer Objective-C extensions are used, you can simply change it to
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain( ...
[pool release];
return retVal;
来源:https://stackoverflow.com/questions/8553278/coreplot-expected-token-before-token