如何删除搜索结果表视图?

时间:2010-08-13 09:42:56

标签: iphone objective-c cocoa-touch uitableview uisearchdisplaycontroller

我有一个UISearchDisplayController,在用户搜索后会显示一些单元格。用户点击单元格后,我将新视图推送到导航堆栈。如何从视图中删除searchResultsTableView,以便当用户返回时,他没有看到searchResultsTableView?

1 个答案:

答案 0 :(得分:2)

请参阅UISearchDisplayController sais的文档:

setActive:animated:
Displays or hides the search interface, optionally with animation.

- (void)setActive:(BOOL)visible animated:(BOOL)animated


Parameters
visible
YES to display the search interface if it is not already displayed; NO to hide the search interface if it is currently displayed.

animated;
YES to use animation for a change in visible state, otherwise NO.


Discussion
When the user focus in the search field of a managed search bar, the search display controller automatically displays the search interface. You can use this method to force the search interface to appear.

Availability
Available in iPhone OS 3.0 and later.
Declared In
UISearchDisplayController.h