What to do if you get the error message unrecognized selector send to instance "***"
Development environment
Swift5, Xcode 12.3.
The project name being created is "EngineerApp".
About the error
I'm sorry it's hard to see, but when I look at the red part of the image
unrecognized selector send to instance "EngineerApp"
There is.
Cause and remedy
The problem occurred with the button connected to the tableViewCell, but as a confirmation procedure
- Select Button in Storyboard
- In that state, select the rightmost icon in the area where you can edit the properties on the right side.
Then, the following screen will be displayed on the right side.
If you look at this Touch Up Inside, you can see that the two methods are linked. In this case, there was something that was connected by IBAction on the upper side in the past, and it was not changed on the Storyboard side by changing the method name or deleting only the method on the code side. When I pressed ❎ to erase it, the error disappeared.
Summary
If the error "unrecognized selector send to instance" occurs, check if the changes have been made on the Storyboard side and if there are any unnecessary connections left.
Thank you for reading until the end. I'm glad if you can use it as a reference. If you have any suggestions or other countermeasures, please feel free to comment.