So I’ve got a UITableViewController and on didSelectRowAtIndexPath: I want it to display a UIPopoverController in a fixed spot on the screen, for this situation I want the arrow pointing to the right in landscape mode in the middle of the right most portion of the screen. What’s happening is when the list is longer than the screen and when I’ve scrolled down to further entries it will always make the point that it’s pointing at higher and higher eventually off the screen. I understand why what I have isn’t working – just looking for the solution. The code I currently have is pasted below if anyone could help out it would be greatly appreciated!
popController = [[UIPopoverController alloc] initWithContentViewController:aPlayerDetail];
popController.popoverContentSize = CGSizeMake(320, 580);
[popController presentPopoverFromRect:CGRectMake(1024, self.view.frame.size.height / 2, 1, 1) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionRight animated:YES];
[playerDetailViewController setPopover:popController];
Use the
boundsinstead of theframeand offset the popover’sycoordinate by the currentbounds.origin.ywhich changes as you scroll up/down: