【发布时间】:2013-05-04 23:25:39
【问题描述】:
我已经使用情节提要实现了UIPopoverController,但是当我在UITableView. 中选择特定行时,我无法将其关闭
When select particular row so that time I want to dismiss the popover but I am not able dismiss it.
我为此编写了以下代码:
//在Main UIViewController中显示弹出框
-(IBAction)clickNotes:(id)sender {
NSLog(@"notes:");
NoteList *objNoteList = [[NoteList alloc] initWithNibName:@"NoteList" bundle:nil];
popover.delegate = self;
popover = [[UIPopoverController alloc] initWithContentViewController:objNoteList];
popover.popoverContentSize = CGSizeMake(250, 450);
[popover presentPopoverFromRect:CGRectMake(730, 0, 1,1) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
}
//在didSelecteRowAtIndexPath上的另一个UIViewController中隐藏popover
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
Notepad_ipad *objNote = [[Notepad_ipad alloc] init];
NSString *mSelectedNoteText = @"Selected text";
[objNote SelectedNote:mSelectedNoteText];
[objNote.popover dismissPopoverAnimated:YES];
}
【问题讨论】: