CorePlot - '@'标记之前的预期令牌 [英] CorePlot - Expected Token Before '@' token
本文介绍了CorePlot - '@'标记之前的预期令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
@令牌之前的预期表达式
int main(int argc,char * argv [])
{
@autoreleasepool {
return UIApplicationMain (argc,argv,nil,NSStringFromClass([ProjectFiveAppDelegate class]));
}
}
解决方案
最近引入了@autoreleasepool语法,您可能需要安装Xcode 4.2。另一种可能性是,您的编译器设置为GCC,AFAIK不支持那些较新的Objective-C更改。
如果这是更新的Objective-C扩展的唯一地方被使用,您可以简单地将其更改为
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(...
[pool release];
return retVal;
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]));
}
}
解决方案
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;
这篇关于CorePlot - '@'标记之前的预期令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文