I have a navbar with a bar buttonitem on it. how would I go about changing the selector on the first press. I basically want to have the first press trigger the “showMenuView” selector and then while that’s displayed change the barbuttonitem selector to be “hideMenuView”
here’s the code I have so far:
UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"globe.png"] style:UIBarButtonItemStyleBordered target:self action:@selector(showMenuView:)];
thanks for any help
You could set a new action.
But I think it would be a better practice to use a
toggleMenuView:method, have a BOOL variable indicating wether or not your menu is visible and then hide or show it in toggleMenuView: