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];
我无法在UINavigationController中添加UIBarButtonItem,请帮忙
答案 0 :(得分:3)
在这里说出袖口,也许不是
[[self.navigator navigationItem] setLeftBarButtonItem:nextButton];
使用
self.navigator.navigationBar.items = [NSArray arrayWithObject:nextButton];
做你想做的事。