Cannot create outlet connections to subviews in Interface Builder (Xcode 5)

后端 未结 5 1409
悲哀的现实
悲哀的现实 2020-12-02 16:32

I know this appears to be a duplicate of some other questions, but the answers are not working for me.

  1. I have created a single view app.
  2. In the stor
5条回答
  •  情书的邮戳
    2020-12-02 17:24

    The issue has to do with the File Owner of the View Controller. It is probably set up as being IOViewController, thus you can only make property connections in that .h file.

    What you can do, is create another .nib file for the subview and put the subview in there. Then in that .nib file, make the file owner IOSubview. Property connections will work just fine there. Then just add the subview to your IOViewController programatically. Just remember to load the nib file from bundle first.

提交回复
热议问题