Created
October 9, 2013 22:33
-
-
Save Pretz/6909690 to your computer and use it in GitHub Desktop.
C macro for creating handy static constants in obj-c. Is this a bad or good idea?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define STATIC_CONST(name) static NSString * const name = @#name; | |
STATIC_CONST(LearningNavRestorationIdentifier) | |
STATIC_CONST(ProfileNavRestorationIdentifier) | |
STATIC_CONST(ReservationsNavRestorationIdentifier) | |
#undef STATIC_CONST | |
// Becomes: | |
static NSString * const LearningNavRestorationIdentifier = @"LearningNavRestorationIdentifier"; | |
static NSString * const ProfileNavRestorationIdentifier = @"ProfileNavRestorationIdentifier"; | |
static NSString * const ReservationsNavRestorationIdentifier = @"ReservationsNavRestorationIdentifier"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment