2
 //:  Save Button
                Button (action: {
                    if self.name != "" {
                    let task = Task(context: self.managedObjectContext)
                    task.name = self.name
                   task.priority = self.priority
                    
                    do{
                        try self.managedObjectContext.save()
                        print("New Task: \(task.name ?? ""), Priority: \(task.priority ?? "")")
                    } catch {
                        print(error)

the error I get from this code 'use of unresolved identifier 'Task'

Task is the name of the entity I created for the program/app. I'm certain. this is a simple one.

im able to run the app complete, despite the error, but the function of 'save' not there.

0 Answers0