I have a tab-based application and a UInavigationcontroller for each tab. In TabViewController I implemented UIsegmentedcontrol , searchDisplayController and searchDisplayController . Elements navigationItems, tabledata change depending on the choice of segmentation. And for the segment, I hid the search bar. But when the search bar is hidden, the first row of the table does not respond to didselectrowatindexpath .
Here is my code
Segment Change In Action
- (void)indexDidChangeForSegmentedControl:(UISegmentedControl *)aSegmentedControl { [self changeNavigationItems]; l.text = [NSString stringWithFormat:@"%d",self.segmentControl.selectedSegmentIndex]; if([segmentIndexesToHideSearchBar containsObject: [NSString stringWithFormat:@"%d", self.segmentControl.selectedSegmentIndex]]) { self.searchDisplayController.searchBar.hidden = YES; self.dataTable.frame = CGRectMake(0, 0, self.dataTable.frame.size.width, self.dataTable.frame.size.height); } else { self.searchDisplayController.searchBar.hidden = NO; self.dataTable.frame = CGRectMake(0, 44, self.dataTable.frame.size.width, self.dataTable.frame.size.height); } [self.dataTable reloadData];
}
Other codes are common, others work correctly.
The second problem is when I return from the details view by clicking on a row, changing the table frame is not saved. There is a space in which there was a search bar.
Waiting for help.
source share