Workaround for running the following error in iOS
Terminating app due to uncaught exception ' nsunknownkeyexception ', Reason: ' [<viewcontroller 0x198620 > Setvalue:forundefinedkey:]: This class was not key value Coding-compliant for the key btn. '
Call stack at first throw:
and the Xcode code runs to the Uiapplicationdelegate [self.windowmakekeyandvisible]; When stopped, prompt program received signal "SIGABRT"
The root cause of this problem is that a control in the Xib has been connected to a variable in the Viewcontroller by outlet, and then the variable is deleted, but the connection is not deleted, causing the corresponding key to be found at startup and throwing the exception above.
The solution is as follows:
Locate the controller corresponding to the Xib, and right-click to see if the property associated with a control already does not exist:
Such as:
See if the corresponding property is in Viewcontroller. H also exists, if there is no difference on the red line in the click, Delete the association, and then pull the cable again
IOS Common error Handling 1setvalue:forundefinedkey