我正在尝试完成public
static
const
我已经尝试过了:
ClassA.h
extern const int FEATURES;
ClassA.m
#define THE_CONST 123
ClassB.b
#import ClassA.h
initWithFrame
FEATURES
Xcode不是通过运行时错误,而是undefined symbols for architecture i386: "_THE_CONST", referenced from: ...
我如何与其他班级分享extern
const
?
答案 0 :(得分:11)
ClassA.h
extern const int FEATURES;
ClassA.m
const int FEATURES = <your const value here>;