What's the difference between outlet and referencing outlet in a simple sentence?

后端 未结 2 1878
醉话见心
醉话见心 2021-02-03 13:34

Is outlet connect to a subview and referencing outlet connect to the stuff? Is that it?

2条回答
  •  天涯浪人
    2021-02-03 13:52

    An outlet is a place on the object that you can connect something to. For example, if you have a FooViewController that has an outlet named bar, you might connect an object BazView to that outlet so the bar property on the FooViewController instance points to the BazView object after the nib is loaded.

    A "referencing outlet" is just IB showing you that this object is connected to an outlet on some other object. To use the same example, when you looked at the BazView instance in IB, it would show you a "referencing outlet" to let you know that the BazView is connected to the FooViewController's bar property.

提交回复
热议问题