所以我见过以前的类似问题,但他们没有任何帮助。我也读过Apple的文档,但我无法理解我出错的地方。 AFAIK我在逻辑上做了一切事情,但是当我点击UItoolbar覆盖层上的完成按钮时,按钮可以被按下,但它什么也不做。这显然意味着它无法确认书面代码。但是如何?从barbuttonitem切换视图?
我想在我的UIToolBar上单击完成按钮时调出“TableViewController”的.nib。但下面的内容不允许点击来创建新视图。我该如何纠正这一点?请告诉我我错在哪里,应该替换什么以及为什么。
//Here's the selector:
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:
UIBarButtonSystemItemDone target:self action:@selector(doneButtonPressed)];
下面是我做了我的动作。顺便说一句,uitoolbar没有笔尖,它是imagepickercontroller(相机模式)上的叠加层。
-(void)doneButtonPressed {
TableViewController *tableView = [[TableViewController alloc]
initWithNibName:@"TableViewController" bundle:nil];
tableView.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:tableView animated:YES];
}
//Yet nothing happens when I click on my done button on my overlay. The button can be
clicked nothing happens. Please shed any insight pleasee!
我在您的其他职位的建议仍然有效:http://stackoverflow.com/questions/11712784/created-nib-view-from-uibatbuttonitem#comment15538002_11712784 – Rob 2012-07-30 00:19:46
您能否为您创建'doneButton'的第一块代码提供一些上下文? – oltman 2012-07-30 00:19:48
如果控件真的到达'doneButtonPressed'方法,你可以打印一些日志消息来跟踪吗? – 2012-07-30 00:20:04