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