user4951
user4951

Reputation: 33090

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

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

Upvotes: 8

Views: 10548

Answers (2)

visakh7
visakh7

Reputation: 26400

The term referencing outlet means an outlet in another object that references, or points to, the current object.

As an example, say you have a nib that has a File's Owner and a UITableView in it, among other things. In order for a tableview to work it has a datasource and delegate, which are outlets and can be connected in IB. From the standpoint of the tableview the datasource and delegate are outlets. From the standpoint of the File's Owner the datasource and delegate in the tableview are referencing outlets.

Reference

This previous SO question describes referencing outlet What is a referencing outlet?

Upvotes: 9

Anomie
Anomie

Reputation: 94804

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.

Upvotes: 5

Related Questions