Swift - “use of unresolved identifier”

前端 未结 4 1190
迷失自我
迷失自我 2020-12-07 01:57

I am studying Swift! I want create Main interface on xib. But have error \"use of unresolved identifier\".

Add code from MainViewController

4条回答
  •  猫巷女王i
    2020-12-07 02:50

    You likely didn't add the class to the target. Click on the MainViewController class and open the utilities tab on the upper right corner in Xcode:

    Make sure the appropriate target is checked.

    EDIT: Apparently you don't have target membership there - which is bizarre in and of itself. Try re-creating the MainViewController class from scratch and make sure the correct target is selected:

提交回复
热议问题