O que é Thread 1:breakpoint 1,1? Sempre que rodo meu código ele chega até a tela de inserção mas na hora de inserir para nesse erro,
ViewController
class ViewController: UIViewController {
@IBOutlet var nameField : UITextField?
@IBOutlet var happinessField : UITextField?
var delegate : ViewControllerDelegate?
@IBAction func add() {
if(nameField == nil || happinessField == nil) {
return
}
let name:String = nameField!.text!
if let happiness = Int(happinessField!.text!) {
let meal = Meal(name: name, happiness: happiness)
print("eaten \(meal.name) with happiness \(meal.happiness)!")
if (delegate == nil) {
return
}
delegate!.add(meal) # o erro ocorre nessa linha
if let navigation = navigationController {
navigation.popViewController(animated: true)
}
}
}