user2749248
user2749248

Reputation: 726

How to disable to right navigation bar button in iOS 7?

I have 2 navigation bar buttons added and display it at right. I used this code below and works fine.

UIBarButtonItem right = [getUI navBarButtonHistory:self navLink:@selector(btn_sendPreview:) imageNamed:@"ic_print.png"];


UIBarButtonItem  rightPending = [getUI navBarButtonHistory:self navLink:@selector(btn_pending:) imageNamed:@"ic_pending.png"];

self.navigationItem.rightBarButtonItems = @[right,rightPending];

but my problem is how to disable that two buttons when i click another button?

Upvotes: 1

Views: 1133

Answers (1)

LongNV
LongNV

Reputation: 902

In your IBAction method. You disable those two buttons by traversing through right button items.

for(UIBarButtonItem *button in self.navigationItem.rightBarButtonItems) {
    button.enabled = NO;
}

Is this what you need?

Upvotes: 2

Related Questions