Skip to content

Instantly share code, notes, and snippets.

@Kirow
Created July 8, 2014 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kirow/8f7ddfd13546ff8a0783 to your computer and use it in GitHub Desktop.
Save Kirow/8f7ddfd13546ff8a0783 to your computer and use it in GitHub Desktop.
String Enumeration
//================.h File======================
typedef enum {
EnumType_1,
EnumType_2,
EnumTypeCount // enum count
} EnumType;
//enum to string
extern NSString *const EnumTypeString[EnumTypeCount];
//================.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