我有以下幾點:navigationController問題
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath(NSIndexPath*)indexPath
{
audiChassisInputViewController = [[myAudiChassisInputViewController alloc] init];
[self.navigationController pushViewController:audiChassisInputViewController animated:YES];
self.navigationController.navigationBarHidden = NO;
UIBarButtonItem *retourButton = [[UIBarButtonItem alloc] initWithTitle:@"Retour" style:UIBarButtonItemStyleBordered target:self.navigationController action:@selector(popViewControllerAnimated:)];
[self.navigationController.navigationBar.topItem setLeftBarButtonItem:retourButton];
[self.navigationController.navigationBar.topItem setTitle:@"Chassis Input"];
[retourButton release];
[audiChassisInputViewController release];
}
這workes ...新的視圖顯示。
在新視圖:
myAudiChassisInputViewController.h
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
chassisInputTextView.layer.cornerRadius = 15;
chassisInputTextView.clipsToBounds = YES;
[chassisInputTextView becomeFirstResponder];
UIBarButtonItem *okButton = [[UIBarButtonItem alloc] initWithTitle:@"OK" style:UIBarButtonItemStyleBordered target:self action:@selector(chassisOkPressed)];
[self.navigationController.navigationBar.topItem setRightBarButtonItem:okButton];
[okButton release];
}
我沒有錯誤,但並無大礙欄按鈕shown.Anyone,任何想法,爲什麼?
它的工作原理...但我仍然不明白你的解釋...你能爲我編輯你的答案嗎?謝謝 – adrian
@george我編輯了答案。我希望現在更清楚。 – albertamg
這次很好的解釋! – adrian