Terminating app due to uncaught exception NSUnknownKeyException, reason [How to Solve]

The reason for this is: before I added a variable to the button, but I deleted the variable in the code. At this time, the association is still there, so I can’t find the variable at run time, so there will be an error. At this time, right-click the control object where the variable is located, and see whether the association still exists in the pop-up menu, If it exists, the association will be deleted by clicking the X number of the association, as shown in the following figure:

After deletion, it runs normally

Similar Posts: