when i click this button thee comes a popover for search the text in the view..but when i type god ,so the sentence with go comes inside the popover controller tableviewcell,when i click the cell,the search result show in the popover itself,it is not redirecting to the mainvieww.my code or popover controller is
- (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];
}
in the search page popover controller ,i put this code to redirect to main view
- (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 is the Main view,but now i get the Mainview inside the popover controller.i just want to dismiss this popover controller and navigate to parallelviewcontroller.how to do this.
Thanks in advance.
You can use
method to dismiss popover.
And can refer following link for more info – http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIPopoverController_class/Reference/Reference.html
EDIT –
You can get your class that contains popover by using –