Я программно добавляю UINavigationBar к UIView, и теперь мне нужно добавить к нему UIBarButtonItem.Я пытаюсь использовать следующее:
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(dismissView)];
[header setItems:[NSArray arrayWithObjects:doneButton, nil] animated:NO];
[doneButton release];
Мое приложение вылетает, и я нахожу это в консоли:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIBarButtonItem setNavigationBar:]: unrecognized selector sent to instance 0x4b75c00'
Буду признателен, если кто-то может пожелатьукажите, что я здесь делаю неправильно.
Спасибо.Рики.