Its expected, you need to maintain the reference of headerbtn
as unique by using tag
property for every section
;
Try something similar :
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
// ....
headerbtn.tag = indexPath.section+25;
}
Action for headerbtn
NSIndexPath *selectedIP = [NSIndexPath indexPathForRow:0 inSection:btn.tag - 25];
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:selectedIP];
// Use the cell reference to point out the popOver
// ...........
[popoverController presentPopoverFromRect:[cell convertRect:btn.frame toView:self.view] inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];