views:

72

answers:

1

Hello all,

I was just wondering how can this happen !!

In my iPhone application during a http request loading I am disabling a button in the navigation bar .

But when I am touches the button three or four times the action method gets called after the loading is completed this means that though the button is disabled the touches are detected on it and later the ibaction method is called .

So is this exceptional or is there any way to prevent this ?

Thanks ....

+2  A: 

Setting a UIControl disabled does not prevent it from getting touch events (and you shouldn't override -touchesBegan: etc on a UIControl anyway).

You should set the button's userInteractionEnabled property to NO to avoid the touch events.

KennyTM
self.navigationItem.rightBarButtonItem.enabled = NO;I am doing this right now . but I am not getting the property userInterationEnabled = NO.
hib
@hib: How do you can touches to a toolbar button?
KennyTM