Hamza Imran
Hamza Imran

Reputation: 189

Issue while moving to a view Controller in IOS

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

Answers (3)

Nirmalsinh Rathod
Nirmalsinh Rathod

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

Chanchal Warde
Chanchal Warde

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

Rahul Mehndiratta
Rahul Mehndiratta

Reputation: 153

  1. Goto storyboard or nib file and Right click on class name here you see all object connection with class. you must be sure there is no yellow warning symbol in connection pop-up.

Upvotes: 0

Related Questions