使用UISeachController iOS 8时,不鼓励在分离的视图控制器上显示视图控制器

时间:2014-11-12 03:04:23

标签: ios8 uisearchcontroller

我在iOS 8中集成UISearchController时收到此警告。我的项目中没有使用storyboard。

Presenting view controllers on detached view controllers is discouraged when using UISeachController iOS 8

1 个答案:

答案 0 :(得分:6)

您需要实现UISearchControllerDelegate

这是一个例子

 # pragma mark - UISearchControllerDelegate

 - (void)presentSearchController:(UISearchController *)searchController
 {
    [self.navigationController presentViewController:searchController animated:YES completion:nil];
 }

如果您有任何其他问题,请告诉我。