Hello stackoverflow,
So I have been searching everywhere for a solution to this problem. I have a table view that displays a popover from a cell when the user selects it. However there is a bug but I can't figure out a solution. Basically once you scroll down off the first page of results, the popover always appears from the bottom of the screen instead of the selected table cell. The reason for this is I am creating the popover from the cell rectangle via:
CGRect cellRect = [tableView rectForRowAtIndexPath:indexPath];
self.detailController.contentSizeForViewInPopover = CGSizeMake(cellRect.size.width, 350);
self.personDetailPopoverController = [[[UIPopoverController alloc] initWithContentViewController:self.detailController] autorelease];
[self.personDetailPopoverController presentPopoverFromRect:cellRect
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
This works great for the first 8 rows (my cells are 100 units tall), but causes that problem noted above because it is trying to display it at y=1400 (for the 14th cell, etc). Does anyone know of a better way to display the popover from the selected cell? Perhaps a creative use of touches? Any feedback would be greatly appreciated. Thanks!