Created
July 8, 2014 08:39
-
-
Save Kirow/8f7ddfd13546ff8a0783 to your computer and use it in GitHub Desktop.
String Enumeration
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
//================.h File====================== | |
typedef enum { | |
EnumType_1, | |
EnumType_2, | |
EnumTypeCount // enum count | |
} EnumType; | |
//enum to string | |
extern NSString *const EnumTypeString[EnumTypeCount]; |
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
//================.m File====================== | |
NSString *const EnumTypeString[EnumTypeCount] = { | |
[EnumType_1] = @"Type1", | |
[EnumType_2] = @"Type2", | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment