User-1070892
User-1070892

Reputation: 929

How to Disable Multiple Buttons in iphone?

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

Answers (2)

Roman Temchenko
Roman Temchenko

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

kush
kush

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

Related Questions