You can put primitives in an NSArray or NSDictionary by packing them with the @() syntax. For example:
typedef enum {
MyEnumOne,
MyEnumTwo
} MyEnum
NSDictionary *dictionary = @{
@(MyEnumOne) : @"one",
@(MyEnumTwo) : @"two"
};
But how do you then use this with fast enumeration? For example, something like:
for (MyEnum enum in dictionary) {
...
}
This results in the error Selector element type 'MyEnum' is not a valid object