views:

316

answers:

1

I've tried a lot of different code examples including just brute force try this try that but, stumped.

The popover left arrow seems to display just fine if the first row is displayed at the very top of the table view but, when the table scrolls down the popover left arrow doesn't align correctly with the table row selected. Solutions or suggestions would be most appreciated.

CGRect myFrame = [tableView rectForRowAtIndexPath:indexPath];

[self.editViewPopoverController setPopoverContentSize:CGSizeMake(320, 400)];

[self.editViewPopoverController presentPopoverFromRect:CGRectMake(myFrame.origin.x, myFrame.origin.y + offset, 400, 0) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];

Thanks.

A: 

Ok, I think I was way off base. Does this make more sense? It seems to work but, is it correct?

UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
CGPoint cellPoint = cell.center;
CGPoint cellViewPoint = [[cell superview] convertPoint:cellPoint toView:self.view];

[editViewPopoverController presentPopoverFromRect:CGRectMake(cellViewPoint.x, cellViewPoint.y + 20, 0, 0) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];

Also, in the splitview (landscape) the popover is center of the screen. I can compensate by increase x but, is there a way to get the cell point within the tableview of the detailview?

Thanks.

Jack Cody