CorePlot - Expected Token Before '@' token

自闭症网瘾萝莉.ら 提交于 2019-12-24 00:46:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!