视图之间的导航
我有带有 UITabBarController 的应用程序。第一个选项卡有 UINavigationController,它是 UITableViewController。我的意思是我的底部有选项卡,在第一个选项卡中我有一个可以导航到其他视图的表格。触摸其中一个单元格后,我使用 MKMapView 调用视图
if([indexPath section] == 3){
LocationDetailViewController *dvController = [[LocationDetailViewController alloc] initWithNibName:@"LocationDetailView" bundle:[NSBundle mainBundle]];
dvController.locationGPS = self.locationGPS;
[self.navigationController pushViewController:dvController animated:YES];
LocationDetailViewController 的定义如下
@interface LocationDetailViewController : UIViewController <MKMapViewDelegate>
:我有一个带有带有操作的按钮的工具栏:
- (void)myCurrentAddress:(id)sender {
AddressDetailViewController *dvController = [[AddressDetailViewController alloc] initWithNibName:@"AddressDetailView" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:dvController animated:YES]; }
AddressDetailViewController 的定义如下:
@interface AddressDetailViewController : UIViewController
当我尝试使用代码时:
- (void)myBackAction {
[self.navigationController popViewControllerAnimated:YES]; }
它不执行任何操作。调试器在此行停止 - 然后继续,没有警告或错误 - 但屏幕上没有任何变化。如果我删除自己的后退按钮,将生成标准后退按钮,它将导航回导航栏,但不会导航回视图。 另外,如果我从另一个 tableviewcontroller 类导航到 AddressDetailViewController ,那么一切都可以,您应该在哪里查找以找出问题?请帮忙))
I have app with UITabBarController. First tab has UINavigationController and it is UITableViewController. I mean I have tabs at the bottom and in first tab I have a table with possibility to navigate to other views. After touching one of cells I call view with MKMapView
if([indexPath section] == 3){
LocationDetailViewController *dvController = [[LocationDetailViewController alloc] initWithNibName:@"LocationDetailView" bundle:[NSBundle mainBundle]];
dvController.locationGPS = self.locationGPS;
[self.navigationController pushViewController:dvController animated:YES];
LocationDetailViewController is defined like
@interface LocationDetailViewController : UIViewController <MKMapViewDelegate>
in it I have a toolbar with button with action:
- (void)myCurrentAddress:(id)sender {
AddressDetailViewController *dvController = [[AddressDetailViewController alloc] initWithNibName:@"AddressDetailView" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:dvController animated:YES]; }
AddressDetailViewController is defined like:
@interface AddressDetailViewController : UIViewController
When I try to use code:
- (void)myBackAction {
[self.navigationController popViewControllerAnimated:YES]; }
it doesn't do anything. Debugger stops on this line - and then continues with no warnings or errors - but no changes on screen. If i remove my own back button and standard back button will be generated it will navigate back NavigationBar but not the view.
Also if I navigate to AddressDetailViewController from another tableviewcontroller class then eveyrhing is ok, where you should look into to find out the problem? please help ))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
愚蠢的我
- (void)viewWillDisappear:(BOOL)animated {
[self.navigationController popViewControllerAnimated:NO];
在 LocationDetailViewController 中 - 删除后一切正常,抱歉)
stupid me i had
- (void)viewWillDisappear:(BOOL)animated {
[self.navigationController popViewControllerAnimated:NO];
in LocationDetailViewController - after removing it everything is ok, sorry )