Reputation: 189
I have a button that, when clicked, opens new view controller. The new view controller that it opens is a form which have some textfields, drop down menus, and radio buttons. When I click the button to open the view controller, I get the exception error below. I'm confused about where the mistake is. The code is error free, so I don't know where the issue is coming from. The error is:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIButton setDelegate:]: unrecognized selector sent to instance 0x7f9499d27b10'
Upvotes: 2
Views: 77
Reputation: 5186
The issue is due to you button doesn't recognize its selector. Its because method which is binding with the button may be deleted.
Check following steps and check:
1) Open Storyboard
2) Move to your current ViewController
3) Check all buttons' method name which you bind.
4) Check whether all methods are there in controller or not.
5) If you don't want to check all method, remove current method binding from xib/storyboard, and assign new method to all button.
Hope it will help you. :)
Upvotes: 1
Reputation: 983
1) Go to storyboard
2) Select your button and right click
3) Remove action of button
4) Add button IBAction on touchup inside
5) Make sure that IBAction is defined in you swift or .m file
Clean your project and ctrl+R
Upvotes: 0
Reputation: 153
Upvotes: 0