我收到错误'使用未解析的标识符'联系人' '(它是我在' fileName.xcdatamodeld'中作为实体名称提供的名称。)
import UIKit
import CoreData
class ViewController: UIViewController {
let managedObjectContext = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func SaveContact(_ sender: Any) {
let entityDescription = NSEntityDescription.entity(forEntityName: "Contacts",in: managedObjectContext)
let contact = Contacts(entity: entityDescription!,insertInto: managedObjectContext) // Error: Use of unresolved identifier 'Contacts'
}
@IBAction func Findcontact(_ sender: Any) {
}
}