视图之间的导航

发布于 2024-09-26 21:44:46 字数 1418 浏览 1 评论 0原文

我有带有 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

故事↓在人 2024-10-03 21:44:46

愚蠢的我
- (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 )

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文