Good to all.

I have a problem maybe something is not announced (don’t know a newbie in xcode)

when I declare a button and give it for example UIAlerts

// Показывает AlertController /* @IBAction func ShowACPressed(sender: UIButton) { let alertController = UIAlertController(title: "Вход", message: "введите данные для входа", preferredStyle: .Alert) let alertOKAction = UIAlertAction(title: "OK", style: .Default, handler: nil) alertController.addAction(alertOKAction) presentViewController(alertController, animated: true, completion: nil) } */ @IBAction func showACPressed(sender: UIButton) { print("pressed") } 

When you start the simulator and press the button, this error crashes, and in another project I also tried to insert UIAlert, everything also crashed. mistake

    1 answer 1

    The problem is not with UIAlertController , but the fact that there is no ShowACPressed function for the log.

    In the builder interface, select the button that, when clicked, drops and remove unnecessary links.

    • Thanks, it helped, I went to the builder from the right sidebar, from the top right, followed the icon and there I deleted all the functions attached to the button and the left and sidebar with the control dragged it into the ViewController and everything worked. I knew that the buttons became so attached to m $ VS, but I did not know that in xcode either. I know now. Thanks - jcmax