tags:

views:

1100

answers:

3

how to place the arrow of UIPopoverController, over UITableView's selected cell

+1  A: 

I believe the arrow is placed automatically by the popover view itself. So whatever you set the frame of the popover to be, it'll draw its arrow top and center.

Jasarien
+5  A: 

You get to define the CGRect to which you want the popover to point.

CGPoint point = ...; // where they tapped on screen, taken from UIEvent, if you like
CGSize size = ...; // give a size range, maybe the size of your table cell
[popover presentPopoverFromRect:CGRectMake(point.x, point.y, size.width, size.height) 
inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
BigSprocket
+1  A: 

Try getting the CGRect for the selected row using the following method.

CGRect selectedRect = [self.tableView rectForRowAtIndexPath:indexPath];

Then use the rect when you present the UIPopoverController:

[myPopover presentPopoverFromRect:selectedRect .............inView:self.view permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];

Romeo