title: 'An NSManagedObject of class 'className' must have a valid NSEntityDescription.' error
body: <p>I've created simple entity 'CDWorkout' with one attribute 'name' inside CDModel.xcdatamodeld. Name of container in AppDelegate is also 'CDModel'. Class Codegen for 'CDWorkout' is Category/Extension. Here is code for CDWorkout class:</p>
  
  <pre><code>class CDWorkout: NSManagedObject {
  
      class func createWorkout(workoutInfo : Workout, in context: NSManagedObjectContext) -&gt; CDWorkout{
          let workout = CDWorkout(context: context)
          workout.name = "anyName"
          return workout
      }
  }
  </code></pre>
  
  <p>the createWorkout function is called from another viewController with context argument as <code>container.viewContext</code> but it immediately crashes with message:</p>
  
  <blockquote>
    <p>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'An NSManagedObject of class 'Workout_Generator.CDWorkout' must have a valid NSEntityDescription.'</p>
  </blockquote>
  
  <p>What did i forget about?</p>