I want to change the selected scope after user has selected something from a table view. I have tried this:
for (id view in [self.searchDisplayController.searchBar subviews]) {
if ([view isMemberOfClass:[UISegmentedControl class]])
{
UISegmentedControl *scopeBar = view;
scopeBar.selectedSegmentIndex = 1;
}
}
But the scope button i want is still not selected. My search bar doesn't have a subview of class UISegmentedControl.