【发布时间】:2012-02-11 20:37:17
【问题描述】:
当我点击完成按钮时,它应该导航回主视图控制器的地方没有发生任何事情
UIBarButtonItem * button = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
target:self
action:@selector(dismissView:)] autorelease];
[[self navigationItem] setRightBarButtonItem:button];
-(void)dismissView: (id)sender
{
[self.navigationController popToRootViewControllerAnimated:YES];
}
它应该导航回主视图控制器。但它什么也没做。任何想法有什么问题。
感谢您的帮助。
【问题讨论】:
-
请添加更多信息以获取更多上下文。你是如何进入你想要弹出的控制器的?你是推它还是它是一个模态视图控制器?您是否将“完成”按钮连接到 IB 中的该方法?
标签: iphone ios uinavigationcontroller uibarbuttonitem