我无法在我的应用程序中找到随机崩溃的原因。仅当我在 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/