title: Resolving 'Failed to call designated initializer on NSManagedObject class'
body: <p>I'm new to Swift and I'm trying to learn how to use Core Data. But I'm getting this error and I'm not sure what I've done wrong. I've searched online and tried a few things but I can't get it right.</p>
  
  <pre><code>Failed to call designated initializer on NSManagedObject class 'FirstCoreData.Course'
  </code></pre>
  
  <p>When this line executes:</p>
  
  <pre><code>ncvc.currentCourse = newCourse
  </code></pre>
  
  <p>In this function:</p>
  
  <pre><code>class TableViewController: UITableViewController, AddCourseViewControllerDelegate {
  
  var managedObjectContext = NSManagedObjectContext.init(concurrencyType: NSManagedObjectContextConcurrencyType.MainQueueConcurrencyType)
  
  override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
      if segue.identifier == "addCourse" {
          let ncvc = segue.destinationViewController as! NewCourseViewController
          ncvc.delegate = self
  
          let newCourse = NSEntityDescription.insertNewObjectForEntityForName("Course", inManagedObjectContext: self.managedObjectContext) as! Course
          ncvc.currentCourse = newCourse
  
      }
  }
  </code></pre>
  
  <p>Class generated by "Create NSManagedObject Subclass..." for Course entity:</p>
  
  <pre><code>import Foundation
  import CoreData
  
  class Course: NSManagedObject {
  
  // Insert code here to add functionality to your managed object subclass
  
  }
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>import Foundation
  import CoreData
  
  extension Course {
  
      @NSManaged var title: String?
      @NSManaged var author: String?
      @NSManaged var releaseDate: NSDate?
  
  }
  </code></pre>