gpt4 book ai didi

iphone - EXC_BAD_ACCESS 当 popViewControllerAnimated 在基于导航的应用程序中时

转载 作者:行者123 更新时间:2023-12-03 19:12:15 24 4
gpt4 key购买 nike

我不明白为什么在弹出回导航堆栈中的上一个 View Controller 时会崩溃。问题是我正在使用自定义导航栏(原始导航栏被隐藏,我的自定义按钮触发导航 - 推送和弹出 - 相反)。

我得到的痕迹:

Program received signal:  “EXC_BAD_ACCESS”.

#0 0x011a4a60 in objc_msgSend
#1 0x0044e37c in -[UIImageView(UIImageViewInternal) _canDrawContent]
#2 0x003bf3df in -[UIView(Internal) _didMoveFromWindow:toWindow:]
#3 0x003bf1b0 in -[UIView(Internal) _didMoveFromWindow:toWindow:]
#4 0x003bf1b0 in -[UIView(Internal) _didMoveFromWindow:toWindow:]
#5 0x003bdfc4 in -[UIView(Hierarchy) _postMovedFromSuperview:]
#6 0x003b6dfc in -[UIView(Internal) _addSubview:positioned:relativeTo:]
#7 0x003b514f in -[UIView(Hierarchy) addSubview:]
#8 0x005ca471 in -[UINavigationTransitionView transition:fromView:toView:]
#9 0x005c9ed5 in -[UINavigationTransitionView transition:toView:]
#10 0x0043c606 in -[UINavigationController _startDeferredTransitionIfNeeded]
#11 0x0043c292 in -[UINavigationController _popViewControllerWithTransition:allowPoppingLast:]
#12 0x0043bfa9 in -[UINavigationController popViewControllerWithTransition:]
#13 0x0043f62b in -[UINavigationController popToViewController:transition:]
#14 0x000124fa in -[BaseViewController bottomNavigationFiredController:] at BaseViewController.m:187

最佳答案

我遇到了同样的问题,可能是因为您的最后一个 View 不再保留。最好的方法可能是尝试通过创建属性并合成它来保留您之前的 View 。

然后尝试使用

[self.navigationConroller popViewControllerAnimated:YES];

或弹出所需 View

[self.navigationController popToViewController:myview animated:YES];

或弹出到 Root View

[self.navigationController popToRootViewControllerAnimated:YES];

如果它对您有帮助,请告诉我。因为当您尝试转到已发布的 View 时会出现此错误。

关于iphone - EXC_BAD_ACCESS 当 popViewControllerAnimated 在基于导航的应用程序中时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4382432/

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