开发者

How do i enable code blocks in an xcode iPhone project?

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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜