I am experiencing trouble solving this problem: I have created another viewcontroller and started writing code in it. I created the viewcontroller by dragging the view controller from the Object Library onto the main.storyboard. Then I created the associated viewcontroller.swift by using Xcode File > New > File > Cocoa Touch Class.
Now to debug I created a new project, I added a button to the new viewcontroller and added an IBOutlet for that button and an IBAction for that button to the new viewcontroller's .swift file. Then to test it I added code to change the button title when the button is pressed. That worked fine.
But in another project I'm trying to do the same thing but it won't work. To debug, I remove all the code except IBOutlet and IBAction for a single button. Then I input code into the IBAction to simply change the button label. When tapped it crashes the program. What could be the cause ? thanks
Now to debug I created a new project, I added a button to the new viewcontroller and added an IBOutlet for that button and an IBAction for that button to the new viewcontroller's .swift file. Then to test it I added code to change the button title when the button is pressed. That worked fine.
But in another project I'm trying to do the same thing but it won't work. To debug, I remove all the code except IBOutlet and IBAction for a single button. Then I input code into the IBAction to simply change the button label. When tapped it crashes the program. What could be the cause ? thanks