title: How to store a typedef enum in CoreData
body: <p>I have a typedef enum I use to represent a state of a job in a queueing system and it is defined as</p>
  
  <pre><code>typedef enum  {
  kTWjobStateRunning,
  kTWjobStateQueued,
  kTWjobStateError
  }TWjobState;
  </code></pre>
  
  <p>Everything is fine, but now I would like to store it as an attribute in CoreData. My first idea is that an enum is basically an integer, so would wrapping the <code>TWjobState</code> in a <code>NSNumber</code> work? Do I have to use casts to persuade the compiler?</p>
  
  <p><strong>Best practice question</strong><br>
  I saw this use of enums often in Cocoa and Foundation classes and also the use of bitmasks. Is there a more modern, more object-oriented way to achieve the same?</p>
  
  <p><em>Thanks for your help.</em></p>