@IBOutlet weak var textfield1: UITextField!
@IBOutlet weak var outputlbl: UILabel!
@IBAction func findtheweather(sender: UIButton) {
let url = NSURL(string: "http://www.weather-forecast.com/locations/" + textfield1.text! + "/forecasts/latest")!
So the let url is my url and i'm concatenating my text field in the url so we can get the data for the city the user typed in. But when I do that I get a crash and I get - fatal error: unexpectedly found nil while unwrapping an Optional value (lldb).
I have a picture of my code.
this is my log after the crash
Help would be much appreciated.
thanks