xamarin.ios - MonoTouch/Xamarin.iOS 中与 UITableViewController/UISearchDisplayController 相关的崩溃

标签 xamarin.ios crash uitableview xamarin uisearchdisplaycontroller

我无法在我的应用程序中找到随机崩溃的原因。仅当我在 Release模式下构建并在 iPhone 或 iPad 等设备上运行时才会发生崩溃。在模拟器上调试运行时不会发生崩溃。我的猜测是问题与崩溃日志中的这两行有关,

6   UIKit                           0x34a193d0 -[UISearchDisplayController _destroyManagedTableView] + 68
7   UIKit                           0x34a2195a -[UISearchDisplayController dealloc] + 94

我已经上传了我的 UITableViewController 的源代码和完整的崩溃日志,https://gist.github.com/Nordis/6128735

非常感谢所有跟踪崩溃原因的帮助!

更新

我现在已经创建了一个错误报告,我查看了 Rolf 在评论中建议的线程。所以我下载了测试用例,应用了修复。但仍然是完全相同的崩溃,堆栈跟踪与我的非常相似。

https://bugzilla.xamarin.com/show_bug.cgi?id=13703

最佳答案

Rolf 在 Xamarin 提供的解决方案相当简单,我所要做的就是在我的 UITableViewController 中将代码从 Dispose() 移动到 ViewDidDisappear(),

public override void ViewDidDisappear (bool animated)
{
    searchController.SearchResultsSource = null;
    searchController.Delegate = null;

    base.ViewDidDisappear (animated);
}

关于xamarin.ios - MonoTouch/Xamarin.iOS 中与 UITableViewController/UISearchDisplayController 相关的崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17986348/

相关文章:

android - 为什么 onServiceDisconnected 在应用程序崩溃时不会被调用?

iphone - UIColor功能崩溃

ios - 无法将 UISearchController 添加到 UIViewController

ios - UITableViewAutomaticDimension 将具有自动布局约束的单元格内容截断到底部

scala - Ubuntu服务随 “Main Process exited, status 143/n/a”随机停止

ios - 未调用 UISearchDisplayDelegate 方法

mono - iOS 6 Mono 和向后兼容性

.net - 声明 ClientBase 期间设备崩溃

c# - 将 Objective C 转换为 C# - 此代码的等效项是什么?

iphone - xamarin studio (Monotouch) 中出现错误 MT2002