Created
November 29, 2013 12:02
-
-
Save squm/7704751 to your computer and use it in GitHub Desktop.
How safe is @1 as dictionary key. NSInteger, NSUInteger int32_t will always map to the same key?
This file contains hidden or 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
typedef NS_ENUM(int32_t, CFG) { | |
CFG10, | |
CFG20, | |
CFG30 | |
}; | |
NSDictionary *const cfgToString = @{ | |
@(CFG10) : @"CFG10", | |
@(CFG20) : @"CFG20", | |
@(CFG30) : @"CFG30" | |
}; | |
NSDictionary *const cfgFromString = @{ | |
@"CFG10" : @(CFG10), | |
@"CFG20" : @(CFG20), | |
@"CFG30" : @(CFG30) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment