Reputation: 33
I tried to upgrade the swift 2.2 to swift 3.0.
I failed. Now I started a new 3.0 project and copied my files into the new project. How can I get the new project to work with a copy of the main.storyboard I copied from another project?
When I run the project, push the button.
2016-10-16 06:42:40.467952 Service in the Cloud[1812:1637752] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Service_in_the_Cloud.ViewController ButtonAction:]: unrecognized selector sent to instance 0x12002d200'
Any idea to change the links to work?
Upvotes: 1
Views: 176
Reputation: 535121
You need to do one of these things:
change the signature of your action handler so the external name of the parameter is _, e.g,
func ButtonAction(_ sender:Any)
or delete your action in the storyboard and create it afresh
The reason is that Swift 3 changes all the ObjectiveC names of your action handlers so now none of your button actions work.
Upvotes: 2