Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/38.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
Iphone UISearchBar被触摸时会崩溃_Iphone_Objective C_Cocoa Touch_Crash_Uisearchbar - Fatal编程技术网

Iphone UISearchBar被触摸时会崩溃

Iphone UISearchBar被触摸时会崩溃,iphone,objective-c,cocoa-touch,crash,uisearchbar,Iphone,Objective C,Cocoa Touch,Crash,Uisearchbar,我有一个UISearchBar。它可以完美地工作,直到我搜索一次并给出一个结果,如果我再次搜索,当我选择它时它就会崩溃 我有这个方法,它崩溃了。有什么想法吗 [self.billingSearchPopoverController presentPopoverFromRect:[self.billingSearchBar bounds] inView:self.billingSearchBar permittedArrowDirections:UIPopoverArrowDirectionAny

我有一个UISearchBar。它可以完美地工作,直到我搜索一次并给出一个结果,如果我再次搜索,当我选择它时它就会崩溃

我有这个方法,它崩溃了。有什么想法吗

[self.billingSearchPopoverController presentPopoverFromRect:[self.billingSearchBar bounds] inView:self.billingSearchBar permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

请检查以确保您没有提前发布billingSearchPopoverController。

即使我打开了NSZombies,也没有任何控制台日志。虽然我只是在dealloc.Hmmm中发布了
billingSearchPopoverController
,但我在堆栈跟踪中得到了这个。。所以你在撞车的控制台里什么都没有。在没有看到更多代码的情况下,我建议您使用断点并逐步完成应用程序。除非您在设备上运行,否则我会查看您的内存占用。我已经设置了断点。这就是我如何把它缩小到我在问题中发布的一行。啊,好的。我唯一能想到的另一件事是,在第一次搜索之后,搜索栏上发生了一些事情。尝试将此片段“[self.billingSearchBar bounds]”更改为[self.view frame]。这当然不会产生预期的效果,但会帮助你缩小崩溃的范围;如果它崩溃了,你知道问题出在搜索栏上。