Interface Builder won't allow connections to custom UIView class?

前端 未结 5 1741
野的像风
野的像风 2021-01-02 09:44

Using Xcode 4.3.3, I can\'t figure out how to connect outlets in a custom UIView class with objects created in Interface Builder.

In one ViewController, I have a var

5条回答
  •  天命终不由人
    2021-01-02 10:25

    What you're trying to do is certainly both sensible (IMO) and possible. XCode is however quite quirky when it comes to establishing connections to outlets in subviews.

    I've found that cleaning, rebuilding and sometimes restarting XCode tends to help, but sometimes it just doesn't work. In some cases I got it working by manually creating the outlet and dragging from the outlet to the control rather than the other way.

    This is not very helpful, I know, but I just wanted to make it clear that this is supposed to work and when it doesn't it is most certainly due to a bug in XCode.

提交回复
热议问题