I'm getting this error:
[Clima.WeatherViewController searchPressed:]: unrecognized selector sent to instance 0x7f996b204020 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Clima.WeatherViewController searchPressed:]: unrecognized selector sent to instance 0x7f996b204020'
Here is my code:
IBOutlet weak var searchField: UITextField!
IBAction func searchedButtonPressed(_ sender: UIButton) {
searchField.endEditing(true);
print(searchField.text!)
}
searchPressed
on a view controller that does not have asearchPressed
function. – DonMagConnections Inspector
pane. I'm guessing your button has a connection tosearchPressed
but your renamed the function in your code tosearchedButtonPressed
– DonMag