“loaded nib but the view outlet was not set” exception

后端 未结 6 2004
别那么骄傲
别那么骄傲 2020-12-06 00:41

I am trying to use UINavigationController. I have two views which are being created programmatically. When a UIButton is pressed on the first v

6条回答
  •  时光说笑
    2020-12-06 01:14

    If you are not seeing the "view" outlet to select from on the "Connections inspector" (rightmost) tab, I found that I had to go back to a generic view controller (e.g., UICollectionViewController) for the File's Owner Custom Class instead of my subclass that I had entered previously. After closing and reopening Xcode, the view outlet appeared again so I connected it as described in sagarcool89's answer. I then set my File's Owner Custom Class back to my subclass and have finally moved past this error.

提交回复
热议问题