gpt4 book ai didi

ios - 放松到 HomeViewController 的正确方法?不平衡误差

转载 作者:行者123 更新时间:2023-11-28 20:01:30 26 4
gpt4 key购买 nike

我有一个应用程序,我一直在与明显糟糕的教程作斗争,并且在之前的线程中撕毁了一个新的教程,所以有点担心再次发布。抱歉,我一直都是边做边学。

无论如何,我的登录、注册和其他功能都运行良好。我只是在使用 AVFoundation 进行条码扫描时遇到了困难。我设置我的流程去

Barcode Scan Flow
(来源:leaguelaunch.com)

按钮单击 HomeViewController 以在扫描后转到 BarcodeViewController,它会推送到 ScanResultsViewController。

ScanResultsViewController 将发送 JSON 发布数据并呈现响应,但由于我收到的错误,我这里什么都没有。我在这里只有这段代码可以直接展开到 HomeViewController,而不必先推回 (BarcodeView) 然后再推回 (HomeView)

- (void)viewDidLoad
{
[super viewDidLoad];
UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStyleBordered target:self action:@selector(back)];
self.navigationItem.hidesBackButton = YES;
self.navigationItem.leftBarButtonItem = item;
NSLog(@"Made it to Success!!!");
}

-(void)back{
[self performSegueWithIdentifier:@"unwindToHomeResult" sender:self];
}

如您所见,它会起作用,但在我收到错误之前它可能会起作用一次,也可能会起作用 10 次。

2014-05-25 12:11:32.378 selfcheckin[3344:60b] QR Code = {"stop_id":"3","event_id":"1"}
2014-05-25 12:11:32.801 selfcheckin[3344:60b] StopReading Called
2014-05-25 12:11:32.812 selfcheckin[3344:60b] Made it to Success!!!
2014-05-25 12:11:42.615 selfcheckin[3344:60b] QR Code = {"stop_id":"3","event_id":"1"}
2014-05-25 12:11:43.322 selfcheckin[3344:60b] StopReading Called
2014-05-25 12:11:43.334 selfcheckin[3344:60b] Made it to Success!!!
2014-05-25 12:11:50.850 selfcheckin[3344:60b] QR Code = {"stop_id":"3","event_id":"1"}
2014-05-25 12:11:51.296 selfcheckin[3344:60b] StopReading Called
2014-05-25 12:11:51.308 selfcheckin[3344:60b] Made it to Success!!!
2014-05-25 12:11:51.349 selfcheckin[3344:60b] QR Code = {"stop_id":"3","event_id":"1"}
2014-05-25 12:11:51.352 selfcheckin[3344:60b] StopReading Called
2014-05-25 12:11:51.370 selfcheckin[3344:60b] nested push animation can result in corrupted navigation bar
2014-05-25 12:11:51.759 selfcheckin[3344:60b] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
2014-05-25 12:11:51.851 selfcheckin[3344:60b] Unbalanced calls to begin/end appearance transitions for <ScanResultsViewController: 0x14e86570>.

所以我的主要问题是如何从 ResultsView 返回到 HomeView。我很想取消 NavigationController,看看我是否可以不用它。关于我可能出错的地方或正确方法的任何指示

谢谢

最佳答案

您可以通过在导航 Controller 上使用 popToRootViewController 返回到第一个 View Controller 。

[self.navigationController popToRootViewControllerAnimated:YES];

关于ios - 放松到 HomeViewController 的正确方法?不平衡误差,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23857640/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com