unrecognized selector sent to instance
There’s a simple way to screw your code and get “unrecognized selector sent to instance” error. By dragging an action from an Interface Builder button to the implementation file multiple times. So if you press a button and your app crashes with “unrecognized selector sent to instance” error, select the button that is crashing (when you press it) in Interface builder and go to Connections Inspector. Look there for multiple actions to the same event.
See next screenshot:
Here we notice Ok button has to connections to the implementation file. If you’ve added by mistake first connection and decide to delete it later, letting only the second one without sender parameter, then we try to run our app, we will notice that our app will crash when we press Ok button.
If we inspect our connections we noticed even if we’ve deleted one of the two actions we still have there both actions. See next picture.