gpt4 book ai didi

crash - 重新显示模态视图模型时,MvvmCross 应用程序卡住并崩溃

转载 作者:行者123 更新时间:2023-12-03 16:55:21 25 4
gpt4 key购买 nike

我正在开发的应用程序由数据层次结构和用于搜索该数据的过滤器组成。数据显示在表格 View 的层次结构中,并且通过该层次结构进行导航可以正常工作。但是,当我尝试导航到我的过滤 View 模型(显示为模态视图 Controller )时,我遇到了问题。

我第一次打开模态视图时,一切正常,我可以关闭它,所有导航仍然有效。但是,当我再次尝试打开它时,会出现模态视图,并且应用程序将在几秒钟后卡住并崩溃。

这是我的自定义演示器(它是 MvxModalSupportTouchViewPresenter 的子类)中处理模态导航请求的代码:

public override void Show (IMvxTouchView view)
{
if (view is IMvxModalTouchView) {
var newNav = new UINavigationController ();
newNav.PushViewController (view as UIViewController, false);
newNav.NavigationBar.TintColor = UIColor.Black;
PresentModalViewController (newNav, true);
return;
...

(取自 MvvmCross Using a modal ViewController from a Tab)

我通过在 View 本身中将其关闭来关闭模式。有谁知道为什么应用程序崩溃了?

最佳答案

通过电子邮件跟进此事是...

"As to my previous question, I found where the error was. The view associated with my modal view model got into an infinite loop of Dispose() calls. It would only happen if the modal was shown multiple times. Commenting out the Dispose() method allowed me to open it multiple times."



目前不确定这是否是 mvx 框架或应用程序代码中的错误 - 但我想我会在这里发布它以防它帮助其他人

关于crash - 重新显示模态视图模型时,MvvmCross 应用程序卡住并崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11615114/

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