我已经实现了UIPopoverController
with storyboard,但是当我选择UITableView
中的特定行时,我无法解除它。 关闭didSelectRowAtIndexPath上的UIPopoverController
当选择特定的行,以便时间我想解雇popover,但我不能解雇它。
我下面写的代码如下:
//显示在主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];
}
//隐藏在另一个UIViewController中的酥料饼上didSelecteRowAtIndexPath
- (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];
}