Question

I've noticed while connecting an outlet that if I place the code outside of the brackets it makes the outlet into a property. How does it behave differently than a regular IBOutlet?

enter image description here

Was it helpful?

Solution

There is no such thing as a "regular IBOutlet". IBOutlet is just an internal keyword giving Xcode a hint that it should allow the making of an outlet by this name in Interface Builder. What you're describing really has nothing to do with the IBOutlet keyword at all. It's just the ordinary difference between an instance variable declaration and a property declaration.

  • An instance variable is an instance-level variable.

  • An accessor method is a method for getting or setting an instance variable.

  • A property is shorthand for calling / declaring accessor methods (and with synthesis, the declaration is shorthand for generating the accessor methods).

And see my book for endless details...!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top