简体   繁体   English

仅当popToViewController时,iOS 8中的EXC_BAD_ACCESS

[英]EXC_BAD_ACCESS in iOS 8 only when popToViewController

Ive been working on this problem for the past week and I have not been able to solve it. 在过去的一周中,我一直在努力解决这个问题,但我一直无法解决。 I was able to find where specifically the exception was being thrown from the help of some stack overflow advice using Zombie process and found that when i do a popToViewController in iOS 8 for some reason iOS 8 looses something in my flow but i have no idea what it is. 我能够使用Zombie进程从一些堆栈溢出建议的帮助中找到专门在哪里抛出异常,并发现当我出于某种原因在iOS 8中执行popToViewController ,iOS 8 popToViewController了我的流程,但我不知道该怎么办它是。 I think it may have to do with the navigationController and I've tried various ways to popToViewController . 我认为这可能与navigationController并且我尝试了各种方法popToViewController

My question is if anyone sees what the culprit might be in the below code ALSO is there a better way to pop to a view controller for iOS 8 users. 我的问题是,是否有人在下面的代码中看到了罪魁祸首?此外,还有一种更好的方法可以弹出至iOS 8用户的视图控制器。 The crash occurs when the user is back at View 2 and presses on any button in the view whether it be a UIButton that moves to another view or tries to move back using the navigationButton . 当用户返回到View 2并按下视图中的任何按钮(无论是UIButton移至另一个视图还是尝试使用navigationButton移回)时,都会发生崩溃。

The flow is this: View 1 --> View 2 --> View 3 --> View 4 === View 4 pops back to View 2 : 流程是这样的: View 1-> View 2-> View 3-> View 4 === View 4弹出回到View 2

VIEW 4: ChooseTempatureViewController : 视图4: ChooseTempatureViewController

Class classToPopTo = [BuildTempatureViewController class];
        for (UIViewController *view in [self.navigationController.viewControllers objectEnumerator]) {
            if([view class] == classToPopTo){
                NSLog(@"%s STARTED POP TO", __PRETTY_FUNCTION__);
                [self.navigationController popToViewController:view animated:YES];
                return;
            }
        }

View 2 : TempatureViewController : 视图2: TempatureViewController

Press any button and receive EXC_BAD_ACCESS and with zombie process enabled it gave me this as the Zombie 按下任意按钮并接收EXC_BAD_ACCESS并且启用了僵尸进程,它给了我这个僵尸

[TempatureViewController navigationController:animationControllerForOperation:fromViewController:toViewController:]: message sent to deallocated instance 0x86d67720

Any Advice to help my iOS 8 users would be greatly appreciated, project is using ARC Also I'm using XIBs 任何帮助我的iOS 8用户的建议将不胜感激,项目使用的是ARC我也使用的是XIBs

Have you tried any other solution, like using Unwind Segue. 您是否尝试过其他解决方案,例如使用Unwind Segue。 Here is an example: https://spin.atomicobject.com/2015/04/23/unwind-segue-set-destination/ . 这是一个示例: https : //spin.atomicobject.com/2015/04/23/unwind-segue-set-destination/ Hope this helps 希望这可以帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM