我已经UIPopoverController
使用情节提要实现了,但是当我在UITableView
.
When select particular row so that time I want to dismiss the popover but I am not able dismiss it.
我为此编写了以下代码:
//在主 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 中隐藏弹出框
- (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];
}