Can't connect IBOutlet in Interface Builder

前端 未结 19 2059
别跟我提以往
别跟我提以往 2020-12-04 20:02

I\'m having a weird experience. I create any type of iPhone application, add a UIViewController with Xib file. I can edit the xib file with controls and see them rendered if

19条回答
  •  Happy的楠姐
    2020-12-04 20:21

    I had the same problem for the LONGEST. Changing my File's Owner "Type" to "MyClassViewController" instead of "UIViewController" in the Class identity window fixed my issue. It makes sense because as the File's owner type is UIViewController it's only going to show those properties specific to the base class. Changing the type to MyClassViewController gives access to it's outlets and all inherited instances. Hope this helps!

提交回复
热议问题