How to add Button in UINavigationController
- by Ali
Hi all ,
navigator=[[UINavigationController alloc]initWithRootViewController:contacts];
UIBarButtonItem *nextButton = [[UIBarButtonItem alloc]
initWithTitle:@"Delete"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(makeCall)];
//[[self.navigator navigationItem] setLeftBarButtonItem:nextButton];
self.navigator.navigationBar.items=[NSArray arrayWithObject:nextButton];
I am adding a button to UINavigationController and got following exception please help me
2011-01-03 11:46:26.626 Appointment[2243:207] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cannot call setItems:animated: directly on a UINavigationBar managed by a controller.'
2011-01-03 11:46:26.634 Appointment[2243:207] Stack: (
3040