Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 当使用UISearchBar弹出到根视图控制器时,iOS内核\u无效\u地址崩溃_Objective C_Crash_Uisearchbar_Poptoviewcontroller - Fatal编程技术网

Objective c 当使用UISearchBar弹出到根视图控制器时,iOS内核\u无效\u地址崩溃

Objective c 当使用UISearchBar弹出到根视图控制器时,iOS内核\u无效\u地址崩溃,objective-c,crash,uisearchbar,poptoviewcontroller,Objective C,Crash,Uisearchbar,Poptoviewcontroller,我的应用程序中有一个问题,导航控制器内部有以下结构: RootView(菜单)-推送->带有UISearchDisplay控制器的UITableViewController-选择行推送->所选对象的详细视图控制器 在详图视图控制器上,有一个返回主菜单的选项,该菜单调用: [self.navigationController popToRootViewControllerAnimated:YES]; 所有这些都可以在模拟器上正常工作。在iphone5s上测试时,我遇到了崩溃 Exception

我的应用程序中有一个问题,导航控制器内部有以下结构:

RootView(菜单)-推送->带有UISearchDisplay控制器的UITableViewController-选择行推送->所选对象的详细视图控制器

在详图视图控制器上,有一个返回主菜单的选项,该菜单调用:

[self.navigationController popToRootViewControllerAnimated:YES];
所有这些都可以在模拟器上正常工作。在iphone5s上测试时,我遇到了崩溃

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x00000001d2a4beb8
Triggered by Thread:  0

Thread 0 Crashed:
0   libobjc.A.dylib                 0x000000018f8479d0 objc_msgSend + 16
1   UIKit                           0x000000018689309c -[UISearchBar willMoveToSuperview:] + 64
2   UIKit                           0x0000000186a6cea0 __UIViewWillBeRemovedFromSuperview + 188
3   UIKit                           0x000000018679c3f0 -[UIView(Hierarchy) removeFromSuperview] + 68
4   UIKit                           0x000000018679f4f8 -[UIView dealloc] + 420
5   UIKit                           0x0000000186883350 -[UIScrollView dealloc] + 968
6   UIKit                           0x0000000186943c3c -[UITableView dealloc] + 1300
7   UIKit                           0x0000000186934108 -[UIViewController dealloc] + 460
8   UIKit                           0x00000001869b85f8 -[UITableViewController dealloc] + 288
它似乎崩溃了,因为出于某种原因,它没有释放UISearchBar。当我删除搜索显示控制器时,一切正常

此外,如果使用UINavigationController提供的“后退”按钮,则不会发生崩溃。只有当我通过搜索从堆栈上高于导航控制器的ViewController弹出到根目录时,才会出现这种情况

任何帮助都将不胜感激,因为我完全被难倒了

  • 编辑- 另一个发现是,所有代理似乎都已正确连接。我正在使用故事板来设计工作流程。如果我删除UISearchBar,但不删除SearchDisplayController,它不会崩溃。它似乎只依赖于UISearchBar元素(这在崩溃日志的基础上是有意义的)

有关于此问题的更新吗?我遇到了完全相同的问题。同样的问题在这里,甚至在方法/选择器名称后面有相同的+偏移量。