views:

172

answers:

1

I just upgraded core-plot to the latest version in an application that was already running successful plots. I followed the fairly simple instructions to the letter, however I'm getting 20 syntax errors in UIView.h. It seems that I'm not alone, but nobody has of yet posted a solution to the issue.

An example:

This code from UIView.h

+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0);

gives the compile error "Syntax error before '^' token":

/var/folders/UO/UOZJs7XuF5iROp2HMSTlz++++TI/-Caches-/com.apple.Xcode.501/CompositeSDKs/iphonesimulator-iPhoneSimulator4.0-drysryiarqddqccmfooifrjfbivi/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:250:0 Syntax error before '^' token in /var/folders/UO/UOZJs7XuF5iROp2HMSTlz++++TI/-Caches-/com.apple.Xcode.501/CompositeSDKs/iphonesimulator-iPhoneSimulator4.0-drysryiarqddqccmfooifrjfbivi/System/Library/Frameworks/UIKit.framework/Headers/UIView.h

It believe the solution is related to the build settings. What would cause this error? I'm not familiar with the (^) syntax in Objective-C.

+5  A: 

The ^ in that context is Apple's implementation of blocks.

My first guess is that you're trying to compile the library with GCC 4.0, which does not recognize the syntax. Perhaps try changing your compiler settings to GCC (or LLVM-GCC) 4.2.

Another compiler-related option that may help is to change the compiler away from GCC entirely. If Clang also has trouble with the compilation, chances are it will show you a better error message.

Matt B.
Yes! It was using GCC 4.0. Changing to GCC 4.2 fixed the problem.
amo
I had the exact same issue. The compiler was set to GCC 4.2 in my case. Changing it to LLVM-GCC 4.2 fixed the issue.
aogan