Is there any way to present an UIPopover from an UITableView index?

Discussion in 'iPhone/iPad Programming' started by guydor, Jul 31, 2010.

  1. macrumors member

    Joined:
    Mar 10, 2009
    #1
    Hi,

    I would like to present an UIPopover from an UITableView specific index. Here's my code:

    Code:
    -  (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if (indexPath.row == 5) {
        [tableView deselectRowAtIndexPath:indexPath animated:YES];
        EnginesPopoverController  *enginesPopoverController = [[EnginesPopoverController alloc] initWithNibName:@"EnginesPopoverController" bundle:nil];
    
        UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:enginesPopoverController];
    
        self.popoverController = popover;
        popoverController.delegate = self;
    
        [popover release];
        [enginesPopoverController release];
    
        CGPoint point = {670, 600};
        CGSize size = {450, 216};
    
        [popoverController presentPopoverFromRect:CGRectMake(point.x, point.y, size.width, size.height) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];                 
    }
    

    If I try to present the Popover from an UIButton it goes well...

    Thanks!
     
  2. tod
    macrumors regular

    Joined:
    Oct 3, 2009
    Location:
    Ohio
    #2
    Would it violate the HIG? Having a Popover show up when touching a tableview cell seems weird, like something they wouldn't allow. Can you show a screenshot of where you want to use it? I'm curious.
     

Share This Page