Reputation: 32237
I'm trying to accomplish a C style version of public
static
const
What I tried doing already:
ClassA.h
extern const int FEATURES;
ClassA.m
#define THE_CONST 123
ClassB.b
#import ClassA.h
initWithFrame
FEATURES
Xcode does not through a runtime error, but rather a build error of undefined symbols for architecture i386: "_THE_CONST", referenced from: ...
How can I share an extern
const
to for another class to use as well?
Upvotes: 3
Views: 3500
Reputation: 4428
ClassA.h
extern const int FEATURES;
ClassA.m
const int FEATURES = <your const value here>;
Upvotes: 11