我想在用户从表格视图中选择某些内容后更改所选范围。我试过这个:
for (id view in [self.searchDisplayController.searchBar subviews]) {
if ([view isMemberOfClass:[UISegmentedControl class]])
{
UISegmentedControl *scopeBar = view;
scopeBar.selectedSegmentIndex = 1;
}
}
但是我想要的范围按钮仍然没有被选中。我的搜索栏没有 UISegmentedControl 类的子视图。