How to use an IBOutletCollection of switches?-Collection of common programming errors
I’m using an IBOutletCollection of switches to set them disabled. After create the IBOutletCollection, I made a for cycle to set them disabled:
for (arraySwitchCounter = 0; arraySwitchCounter < _switchCollection.count; arraySwitchCounter ++) {
UISwitch * disabledSwitch = [ _switchCollection objectAtIndex: arraySwitchCounter ];
[disabledSwitch setEnabled: NO]; }
but it crash on startup, I think trouble is on second row but I don’t know what…how can I solve? Thank you!