views:

78

answers:

1

I'm trying to enable code blocks in our iphone application so that i can run the static analyzer tool included with xcode. I get this warning (or error, depending on which compiler i use) when i run the build and analyze task:

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:252:72: error: blocks support disabled - compile with -fblocks or pick a deployment target that supports them

I've changed my deployment target to compiler default from iPhone OS 3.0, and i've changed the compiler from GCC 4.2 to LLVM 1.5 and LLVM GCC 4.2 with no luck. I'm not sure what else I have to change to make this work, or where i need to add the -fblocks argument. Does anyone know?

+1  A: 

In SDK 4.0, if you use the new methods including blocks as arguments, then the static analyzer does not work. You must explicitly enable blocks as follows: in your project's settings, put -fblocks in the "Other C Flags" setting.

unforgiven
Really? File a bug, please.
bbum
Problem is that i'm not explicitly using them, but they are present when i include UIKit in the prefix header. that flag fixes it though; thanks for the pointer!
Kevlar