UISearchDisplayController自动创建一个UIPopovercontroller来显示内容搜索结果?!怎么解雇呢? [英] UISearchDisplayController automatically creates a UIPopovercontroller to display content search result ?! How to dismiss it?

查看:63
本文介绍了UISearchDisplayController自动创建一个UIPopovercontroller来显示内容搜索结果?!怎么解雇呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有UISearchBar的UISearchDisplayController。我把这个UISearchBar放在我的应用程序中使用IB得到:

I'm using a UISearchDisplayController with a UISearchBar. I put this UISearchBar in my app using IB and I get :

alt text http://img6.imageshack.us/img6/1985/screenshot20100701at156.png

好的:当你开始录音时,结果是popovercontroller神奇地出现(我没有自己写任何东西让它出现!)

Fine : when you start taping, the result popovercontroller appears magically (I didn't write anything on my own to make it appear !)

然后,当在结果中单击一行时,我想要关闭PopoverController BUT 在这个阶段,我从未在我身边实例化过UIPopoverController:看起来如果在 UISearchDisplayController 中有一个封装的行为,它会自动包装它的 searchContentsController UIPopoverController 中。这真的很棒,因为一切都运行得很好,没有做任何事情,除了我无法获得对这个UIPopoverController的引用来解雇它:(

Then, when a row is clicked among the result, I want to dismiss the PopoverController BUT at this stage, I never instantiated the UIPopoverController on my side : it looks like if there's an encapsulated behavior in the UISearchDisplayController that automatically wraps its searchContentsController inside a UIPopoverController. That's really great because everything works perfectly without doing anything except that I cannot get the reference to this UIPopoverController to dismiss it :(

有谁知道如何获得引用这个神奇地创建的UIPopoverController?
(这是iPad真的是一个神奇设备的证据;)

Does anyone know how to get the reference to this "magically" created UIPopoverController ? (this is the proof the iPad is really a "magical" device ;)

我以为从它的contentController(通过它的父属性)会有一个对UIPopoverController的引用,但我找不到任何方法来获取它的指针:/

I thought there would be a reference to the UIPopoverController from its contentController (through its parent property for instance), but I cannot find any way to get a pointer to it :/

推荐答案

[searchDisplayController setActive:NO animated:YES]; 不工作吗?

这篇关于UISearchDisplayController自动创建一个UIPopovercontroller来显示内容搜索结果?!怎么解雇呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆