1

我无法在我的应用程序中找到随机崩溃的原因。仅当我在发布模式下构建并在 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

4

1 回答 1

0

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

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

    base.ViewDidDisappear (animated);
}
于 2013-08-02T11:51:22.837 回答