Objective c 实现文件可以';看不到头文件中声明的常量
我在头文件中声明的常量的实现文件(注释掉)中收到错误消息。编译器为什么要这样做 提前谢谢 头文件:Objective c 实现文件可以';看不到头文件中声明的常量,objective-c,Objective C,我在头文件中声明的常量的实现文件(注释掉)中收到错误消息。编译器为什么要这样做 提前谢谢 头文件: #import <UIKit/UIKit.h> #define kFilling Component 0 #define kBread Component 1 @interface BIDDoubleComponentViewController : UIViewController <UIPickerViewDelegate, UIPickerViewDataSource&
#import <UIKit/UIKit.h>
#define kFilling Component 0
#define kBread Component 1
@interface BIDDoubleComponentViewController : UIViewController
<UIPickerViewDelegate, UIPickerViewDataSource>
@property (strong, nonatomic) IBOutlet UIPickerView *doublePicker;
@property (strong, nonatomic) NSArray *fillingTypes;
@property (strong, nonatomic) NSArray *breadTypes;
- (IBAction) buttonPressed;
@end
你的定义不好。你有
#define kBread Component 1
但是您使用的是kBreadComponent
。#define
所做的是定义一个名为kBread
的令牌,该令牌在对令牌组件1
进行预处理时进行计算。你可能想用
#define kBreadComponent 1
KLUP和组件和KBULL和组件之间的空白字符的目的是什么?什么是“组件”?
#define kBreadComponent 1