I am trying to learn Xcode/Swift and have a problem.
I get the following error after build and after I have entered my age. Usually its a typo but this is not the case.
Here is the error:
Here is the whole code:
Can anyone help me solve this problem
I get the following error after build and after I have entered my age. Usually its a typo but this is not the case.
Here is the error:
Code Block [CalorieCounter.FirstViewController yourAge:]: unrecognized selector sent to instance 0x144b071
Here is the whole code:
Code Block // // FirstViewController.swift // CalorieCounter // // Created by Tony Hudson on 11/04/2021. // import UIKit var userAge: Double? var userWeight: Double? var userGender: String = "Female" class FirstViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } @IBOutlet weak var yourAge: UITextField! @IBOutlet weak var yourWeight: UITextField! @IBOutlet weak var segmentedControl: UISegmentedControl! @IBAction func genderButton(_ sender: UISegmentedControl) { switch sender.selectedSegmentIndex { case 0: userGender = "Female" case 1: userGender = "Male" default: return } } @IBAction func savePersonalInfo(_ sender: Any) { userWeight = Double(yourWeight.text!) userAge = Double(yourAge.text!) } }
Can anyone help me solve this problem