开发者

#define in precompiled header not recognized in .mm files

Why would a #define statement in a .pch not be recognized by .mm files?

Results in "use of undeclared identifier" and "not declared in this scope" when attempting to reference the macro.

Pch looks like this:

#import <Availability.h>

#ifndef __IPHONE_3_0
#warning "This project uses features only available i开发者_运维知识库n iPhone SDK 3.0 and later."
#endif

#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif

#ifdef DEBUG
#define dNSLog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])
#else
#define dNSLog(format, ...)
#endif


I had the same problem, cleaning was not solving it.

After closing and restarting Xcode 4 everything was fine. If that can help someone...


Turns out Xcode 4 wasn't actually cleaning the build. :(

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜