I am programming an assignment planner for iPhone and have run across an error in my code upon attempting to view my 2nd view. At this point I only have two views, and the first view(main) loads fine upon app launch. The first view is a tableview and the second view has one text field that saves the Assignment title, the second field is a date picker that saves to core data as type String. When I run the code, it gives me no error in the debugger, and just in Thread 1 it throws a SIGABRT error in the AppDelegate.swift file.
This is my action for the second view that should add the assignment
@IBAction func btnAddAssignment(sender: UIButton) {
if (txtAssignment.text == ""){
error.text = "Please try again, you must add a name."
//Task Title is blank, do not add a record
} else {
//add record
//handles date formatting to string
// TODO, Wrap in a method for later use
let dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "dd-MM-yyyy HH:mm"
let strDate = dateFormatter.stringFromDate(due_date.date)
let stringDueDate = strDate
let name: String! = txtAssignment.text!
let final_due_date: String! = stringDueDate
taskMgr.addAssignment(name, due_date: final_due_date)
}
}
"2016-07-26 15:02:28.957 TaskMate[2410:200555] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<TaskMate.FirstViewController 0x7fe9ba520ce0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key tblTasks.'
Any other files that you need please ask for! Thanks!