Reputation: 929
How to Disable Multiple buttons at a time when one button pressed, without creating outlets foreach one in iphone?
Thanks in advance...
Upvotes: 0
Views: 758
Reputation: 1806
You should set YES exclusiveTouch
property for each button. But you cannot do this in IB. So you should maybe loop through all subviews in main view and set this property for all buttons.
Upvotes: 0
Reputation: 438
You can set button tags for you UIButtons and for looping through each button in a view you can use the for-in loop.
for (UIButton *button in self.view.subviews)
{
<#statements#>
}
This should solve your problem and the tag to buttons can u used for referencing the buttons
Upvotes: 4