views:

116

answers:

1

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.

+2  A: 

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.

Rob Napier
I use IBOutlets when I need control over UIViews asynchronous with their events (e.g. press button A, modify image B requires an IBOutlet for B)
David Kanarek