Ali
Ali

Reputation: 11600

I am not able to add UIBarButtonItem in UINavigationController

navigator=[[UINavigationController alloc]initWithRootViewController:contacts];


UIBarButtonItem *nextButton = [[UIBarButtonItem alloc]
       initWithTitle:@"Delete"
       style:UIBarButtonItemStyleBordered
       target:self
       action:@selector(makeCall)];

[[self.navigator navigationItem] setLeftBarButtonItem:nextButton];


[nextButton release];

I am not able add UIBarButtonItem in UINavigationController ,please help

Upvotes: 2

Views: 550

Answers (1)

lambmj
lambmj

Reputation: 1843

Speaking off the cuff here, perhaps instead of

[[self.navigator navigationItem] setLeftBarButtonItem:nextButton];

use

self.navigator.navigationBar.items = [NSArray arrayWithObject:nextButton];

to do what you want.

Upvotes: 3

Related Questions