I am working on a iOS project that uses core data. I am using swift. The Core Data stack is setup right and all seems to be fine. I have created a class for an entity (NSManage
I think I'm getting similar results to you. I was unable to get my tests working with the line
var newDept = NSEntityDescription.insertNewObjectForEntityForName("Department", inManagedObjectContext: moc) as Department
But I could get the tests running with :
let entity = NSEntityDescription.entityForName("Department", inManagedObjectContext: moc)
let department = Department(entity: entity!, insertIntoManagedObjectContext: moc)
My Entity looks like :
@objc(Department)
class Department: NSManagedObject {
@NSManaged var department_description: String
...
}