Calling a uipopupcontroller inside the textfield inside the cell


#1

I have a column with a uitextfield and i tried calling the uipopviewcontroller but it showing raising an error  Terminating app due to uncaught exception ‘NSGenericException’, reason: '-[UIPopoverController dealloc] reached while popover is still visible.'

-(void)showKeypad:(UITextField *)sender
{
    
    
    UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
    TMSTempKeypad *controller = [storyBoard instantiateViewControllerWithIdentifier:@"TMSTempKeypad"];
    
    
    UIPopoverController* popover = [[UIPopoverController alloc] initWithContentViewController:controller];
    popover.delegate = self;
    popover.popoverContentSize = CGSizeMake(320,400);
    
   
    [popover presentPopoverFromRect:sender.bounds inView:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    
  
    
}


//code inside prepareforcelldisplay
  UITextField *txtTemp=[[UITextField alloc]init];
                       
            txtTemp.textAlignment=order.Temp;
            txtTemp.delegate=self;
            
            txtTemp.borderStyle=UITextBorderStyleRoundedRect;
            txtTemp.frame=CGRectMake(25, 5, 29, 25);
            txtTemp.textAlignment=UITextAlignmentRight;
            [txtTemp addTarget:self action:@selector(showKeypad:) forControlEvents:UITextFieldTextDidBeginEditingNotification];
            
            
            [textCell addSubview:button];
            [textCell addSubview:txtTemp];

#2

sorry it works now.