I am externalizing some constants for my app and decided to use an external file Constants.h.
Is this the correct way of doing this? I get a “unexpected ‘@’ in program error. Where should put the #defines in this header file?
//
// Constants.h
@interface Constants : NSObject {
}
#define height 227
#define width 40
@end
EDIT: You found that the error is not from the file
Constants.h, but it is better to do the following:Remove the Declaration of the
Constantsclass. So that the.hfile contains only the constants:Or at least put them before the declaration of the class: