酥料饼和Tableviews

酥料饼和Tableviews

问题描述:

上popovers快速的问题,我似乎没有掌握关闭popview的方式,当我选择它(的tableview)酥料饼和Tableviews

的东西,所以我有一个实现代码如下列表中的项目,其弹出使用UIPopoverController所以当我选择了一个我想让波波夫消失的物品。

MainViewController

- (IBAction)popoverFontName:(id)sender 
    CGRect popoverRect = [self.view convertRect:[popoverFontName frame] 
             fromView:[popoverFontName superview]]; 
    TitleController *titleC=[[TitleController alloc]init]; 
    popup =[[UIPopoverController alloc]initWithContentViewController:titleC]; 

    [popup presentPopoverFromRect:popoverRect inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; 
    [popup setPopoverContentSize:CGSizeMake(50.0, 300.0)]; 

    [titleC release]; 

} 

TitleController

- (void)tableView:(UITableView *)tableView 
didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 

    NSString *selectedLang = [titleList objectAtIndex:indexPath.row]; 

    //Initialize the detail view controller and display it. 
    MyDetViewCont *myDetViewCont = [[MyDetViewCont alloc] initWithNibName:@"myDetViewCont" bundle:[NSBundle mainBundle]]; // view controller instance 

} 

在标题位指示我不知道如何关闭该酥料饼

您可以拨打dismissPopoverAnimated:在popoverController。你应该保留你的popover实例作为一个实例变量,以便解除UITableViewDelegate方法。