syntax error before '^' token in UIView.h - not fixed by changing compiler setting
I installed the latest official iphone sdk and now my personal project is getting the same 开发者_StackOverflow中文版compiler error in UIView.h as described in this question: Syntax error before '^' token
syntax error before '^' token
The solution is apparently to change compiler settings to use GCC 4.2 or LLVM. I've tried using every compiler setting available in Xcode that but am still getting the errors.
Is there something else I should be doing to support the (^) block syntax in my project. The project was building fine with the previous official sdk release (pre OS4)
Another strange detail, I only get the error in debug config, not release. I tried comparing the build settings between debug and release but didnt see any major differences. Where there were differences I tried setting the debug config to use the release config values but still getting those errors.
thanks in advance for any help
ok so I just found my problem.
I was changing build settings by right click -> Get Info on the project but I should have been doing it on the target (which was still using GCC 4.0 even though the project was set to 4.2)
Make sure you have the right configuration or configurations picked when you change compile settings. It's easy to overlook this, for example: picking the Release build when you meant the Debug, or vice versa; or by using other custom build configurations.
精彩评论