I have a navigation controller. The controller works well and shows me the back button for go back to the window. But when I add this code for add the close button:
- (void)viewDidLoad
{
[super viewDidLoad];
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:@"Chiudi"
style:UIBarButtonItemStylePlain target:self
action:@selector(dismissModalViewControllerAnimated:)];
self.navigationItem.rightBarButtonItem = doneButton;
[doneButton release];
}
…then the back button disappears, and I can only see the close button. Why?
THE PROBLEM was in
I HAD TO USE