当我单击此按钮时,您会弹出一个用于在视图中搜索文本的弹出窗口..但是当我输入上帝时,带有 go 的句子进入弹出框控制器 tableviewcell 内,当我单击单元格时,搜索结果显示在弹出框本身,它没有重定向到 mainvieww.my 代码或弹出框控制器是
- (void)Searchpage:(id)sender {
searchpage* popoverContent = [[searchpage alloc]
init];
UINavigationController *navigationController = [[[UINavigationController alloc] initWithRootViewController:popoverContent] autorelease];
//resize the popover view shown
//in the current view to the view's size
popoverContent.contentSizeForViewInPopover =
CGSizeMake(320,650);
//create a popover controller
self.popoverController = [[UIPopoverController alloc]
initWithContentViewController:navigationController];
//present the popover view non-modal with a
//refrence to the button pressed within the current view
[self.popoverController presentPopoverFromRect:CGRectMake(600, 0, 0, 0)
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
//release the popover content
[popoverContent release];
}
在搜索页面弹出控制器中,我将此代码重定向到主视图
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic may go here. Create and push another view controller.
ParallelReadViewController *detailViewController = [[ParallelReadViewController alloc] initWithNibName:@"ParallelReadViewController" bundle:nil];
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
delegate.selectedBook = [[searchResults objectAtIndex:indexPath.row] objectForKey:@"book"];
delegate.selectedChapter = [[searchResults objectAtIndex:indexPath.row] objectForKey:@"chapter"];
delegate.selectedVerse = [[searchResults objectAtIndex:indexPath.row] objectForKey:@"verse"];
[delegate reloadVerses];
}
parallelViewController 是主视图,但现在我在弹出框控制器中获得主视图。我只想关闭此弹出框控制器并导航到 parallelviewcontroller。如何执行此操作。提前致谢。