Reputation: 579
I have a constants.h file that looks something like
#ifndef constants_h
#define constants_h
#define MyAdUnitID @"XXXXXXX"
#define GoogleAnalyticsID = @"XXXXX"
#endif
and want to reference it throughout my other implementation files. These are just simple string values that I want as NSString instances throughout my program, but can't seem to get it to work.
If there is a better practice to this, please let me know!
Upvotes: 2
Views: 2253
Reputation: 19277
Use extern instead of define.
in .h:
extern NSString* SHKFacebookAppID;
in .m:
NSString* SHKFacebookAppID = @"1234567890";
Upvotes: 7