Я хочу добавить элемент панели справа на панель навигации, чтобы при щелчке он выполнял определенную функцию.
Я создал следующий код, чтобы добавить элемент кнопки правой панели, но после этого элемент панели не отображается на панели навигации:
-(void)viewDidload{
self.navigationItem.rightBarButtonItem =
[[[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
target:self
action:@selector(Add:)] autorelease];
}
-(IBAction)Add:(id)sender
{
TAddNewJourney *j=[[TAddNewJourney alloc]init];
[app.navigationController pushViewController:j animated:YES];
[j release];
}