i am using the Cgpoint for get the location of the control in tableview , with indexpath. which is working fine with iphone 5 , iphone 6 and iphone 6s . but its not giving proper cordinate with iphone 4s , please provide solution where i am wrong i am using following code below written .
-
(BOOL)searchBarShouldBeginEditing:(CustomSearchBar *)searchBar{ CGRect cellRect =[self.tblFormDetail rectForSection:searchBar.indexPath.section];
// = [self.tblFormDetail rectForSection:searchBar.tag]; CGPoint origin=[self.tblFormDetail convertPoint:cellRect.origin fromView: self.tblFormDetail]; CGPoint originView=[self.view convertPoint:cellRect.origin fromView: self.tblFormDetail]; NSLog(@"origin from tbl %f",origin.y); NSLog(@"origin from view %f",originView.y); pointScroll=self.tblFormDetail.contentOffset; pointSizeScroll=self.tblFormDetail.contentSize; [self.tblFormDetail setContentSize:CGSizeMake(self.tblFormDetail.frame.size.width,pointSizeScroll.height+originView.y)]; [self.tblFormDetail setContentOffset:CGPointMake(0, origin.y)animated:NO]; } thanks in advance
