我有一個popovercontroller
來顯示一個搜索頁面,它顯示了很好的搜索頁面,當用戶點擊popover內的單元格時,它會顯示popovercontroller
內的相應頁面,我不想要它,所以我把NSNotification
用於顯示popover
,它工作正常,但我遇到了一個問題,但導航不在popovercontroller
那裏發生,只有解僱發生。 這是我的代碼在本頁面viewDidLoad
方法來創建酥料餅UIPopOverViewControler解僱問題
-(void)revealRightSidebar:(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.popup = [[UIPopoverController alloc]
initWithContentViewController:navigationController];
[self.popup presentPopoverFromRect:_btnsearch.frame
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
//release the popover content
[popoverContent release];
[self resetReadViewToVerse:1];
}
我把通知
- (void)viewDidLoad
{
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dismissThePopover) name:@"popoverShouldDismiss" object:nil];
}
在searchpage我把這個代碼導航到相應的搜索結果頁面
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
ParallelReadViewController *detailViewController = [[ParallelReadViewController alloc] initWithNibName:@"ParallelReadViewController" bundle:nil];
//detailViewController.firstString = firstString;
// ...
// Pass the selected object to the new view controller.
[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];
[[NSNotificationCenter defaultCenter] postNotificationName:@"popoverShouldDismiss" object:nil];
}
但是,當我刪除通知時,導航到parallelReadViewController
頁面中的通訊員搜索,但在popover
本身,這裏popover
解僱,但沒有navigation.please幫我做到這一點。
@Atulkumar V.Jain從烏爾側任何幫助嗎? – stackiphone