tags:

views:

27

answers:

1

Problem,

with a UIButton, I can do this:

myButton.enabled = YES;
       or 
myButton.enabled = NO;

However, I can't do the same with a UIBarButtonItem (navigation bar buttons,)

So, how do I stop the user clicking it?

+1  A: 

Sure you can; a UIBarButtonItem is a subclass of UIBarItem, which has an enabled property. Just use that.

Just get a reference to the item and do what you have above:

UIBarButtonItem  *item = self.navigationItem.rightBarButtonItem;

item.enabled = NO;
Ben Gottlieb
how do i do that? i cant seem to figure it out... :S
Sam Jarman
huh. i tried that.well it didnt work last night, but it works now. odd. Cheers Ben.
Sam Jarman