警告:声明不会声明任何内容

时间:2012-02-24 05:35:21

标签: objective-c ios xcode

我的界面文件中出现了一个奇怪的警告。

enter image description here

这也是我为此声明属性的行。

enter image description here

任何人都可以帮助我吗?

2 个答案:

答案 0 :(得分:1)

在项目的某个地方,您有#define定义xOffset什么都不是(除了评论)。像这样:

#define xOffset

或者这个:

#define xOffset // hello

如果您在命令中单击xOffset,您将收到警告(或按住Control键并单击它并从弹出菜单中选择“跳转到定义”),Xcode应跳转到{{1 }}

答案 1 :(得分:0)

我刚刚创建了一个类,编译过,没有错误。这是整个实现文件。

#import <Cocoa/Cocoa.h>

@interface MHAppDelegate : NSObject <NSApplicationDelegate>
{
    float xOffset;
    float yOffset;
}

@property (assign) IBOutlet NSWindow *window;
@property (assign) float xOffset;
@property (assign) float yOffset;

@end
相关问题