views:

3813

answers:

2

I UIButton using + buttonWithType:

What I need to figure out is how to manually change the button state. There are times when I need it to be set to "disabled."

I read through the UIButton documentation but I cannot seem to find anything about manually setting a button state.

Any thoughts would be greatly appreciated.

+10  A: 

Did you try button.enabled = NO;?

Ben Gottlieb
Hey thanks Ben. I didn't even think about looking at the superclass. Big lesson learned on that!
acreek
A: 

Isn't it just the "state" property? It's in the UIControl class which is the superclass of UIButton.

Edit: oops, no it isn't. The docs say "This attribute is read only—there is no corresponding setter method."

Stephen Darlington