I am new to objective-c. I have the following:
@interface HPSEnumerations : NSObject
typedef NSString* HPS_FORMELEMENTTYPE;
extern HPS_FORMELEMENTTYPE Textfield;
extern HPS_FORMELEMENTTYPE Label;
extern HPS_FORMELEMENTTYPE ImageView;
@end
The compiler gives errors with:
Undefined symbols for architecture i386:
“_ImageView”, referenced from:
Can anyone explain what’s happening, and how to fix it? My basic requirement is to have an enumeration where I have string values instead of ints – this looked about as close as I could get.
externdeclaration does not create variable, it is just a promise that variable is created somewhere outside of the current module. To fix your error you need to actually create it in some implementation file (that is declare it without ‘extern’ word):P.S. I’ve also changed enumeration names a bit and there’s no sense to put your “enumeration” into obj-c interface declaration