I'm using Core data with Swift 2.1 and Xcode 7.2 This code gives me an error that can't find the entity name.This as [Company] doesn't work.I have a entity with this name.
let fetchRequest = NSFetchRequest(entityName: "Company")
do {
var result = try self.moc.executeFetchRequest(fetchRequest) as! [Company]
if (result.count > 0){
companyName?.stringValue = result[0].valueForKeyPath("name") as! String
// success ...
}
else{
}
} catch let error as NSError {
// failure
print("Fetch failed: \(error.localizedDescription)")
}