Skip to content

Instantly share code, notes, and snippets.

@andrewsardone
Created October 9, 2012 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save andrewsardone/3859525 to your computer and use it in GitHub Desktop.
Save andrewsardone/3859525 to your computer and use it in GitHub Desktop.
lolenums
// unpredictable backing type for this enum
typedef enum {
CDZTypePhone,
CDZTypeEmail
} CDZType;
// vs.
enum {
CDZTypePhone,
CDZTypeEmail
};
typedef NSUInteger CDZType;
// vs. a better way via Clang's support for C++11 enumerations
// http://clang.llvm.org/docs/LanguageExtensions.html#objc_fixed_enum
typedef enum : NSUInteger {
CDZTypePhone,
CDZTypeEmail
} CDZType;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment