Question

I have some code that works without having referencing outlets for the controls - just event ties in Interface Builder. Is this ok and is a referencing outlet only necessary to change the state of a UI control?

Thanks.

Was it helpful?

Solution

Correct. If your object doesn't need to reference the UI element, there is no reason to bind it with an IBOutlet. IBActions pass the sending UI element as their parameter, and you're free to use that to modify the state of an element as well, rather than using an IBOutlet.

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