-->

NSUnknownKeyException error in app delegate

2019-08-11 02:44发布

问题:

My app is crashing on every screen at app delegate where ever I have used label and textfields. When the tags are removed app is working fine but is crashing again when connected to swift file again.

回答1:

If you have this type of error

STEP 1:Go XIB or if use STORYBOARD go STORYBOARD
STEP 2:Click View Controller
STEP 3:Again Give connection properly(Fill the circle)
STEP 4:Also check whether it is for button action or outlet property

Very Important: Right Click the File's Owner(Yellow Color) and Click on the "Connection Inspector" (upper right arrow), to see all outlets at once. Look for !s which indicates a missing outlet.Remove that. Now it works.