我有三個頁面。每個頁面將這些值推送到下一頁,如下所示:bookpage ---------- values passed to> chapterpage ---------- values passed to> verse page。當用戶點擊主頁面上的按鈕時,它會顯示一個包含書頁的模型表單。代碼是這樣的:如何解除iPhone中的表單模型視圖
BookSelectionview *detailViewController = [[BookSelectionview alloc] initWithNibName:@"BookSelectionview" bundle:nil];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:detailViewController];
navController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
navController.modalPresentationStyle = UIModalPresentationFormSheet;
UIBarButtonItem *doneBarButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
target:self
action:@selector(modalViewDone)];
detailViewController.navigationItem.rightBarButtonItem = doneBarButton;
detailViewController.navigationItem.title = @"Book Selection";
[doneBarButton release];
[self.navigationController presentModalViewController:navController animated:YES];
[detailViewController release];
[navController release];
[self resetReadViewToVerse:1];
}
然後在我的章節頁面中,我編寫了這段代碼來導航並將一些值傳遞給詩句頁面。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
ChapterSelectionView *detailViewController = [[ChapterSelectionView alloc] initWithNibName:@"ChapterSelectionView" bundle:nil];
detailViewController.contentSizeForViewInPopover = CGSizeMake(500, 600);
//detailViewController.firstString = firstString;
// ...
// Pass the selected object to the new view controller.
detailViewController.selectedIndex=indexPath.row;
appDelegate.selectedBookIndex=indexPath.row;
self.hidesBottomBarWhenPushed=YES;
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
}
,並在此節的頁面是問題....在壽頁面包含經文這是當使用點擊任意按鈕,按鈕的形式,它需要去到主視圖,並顯示相應的詩歌,但它顯示在表單裏面的主頁,與通訊員的詩句..所以我把dismissmodelview動畫:是的代碼。但它兌現..我的代碼在詩歌頁面其按鈕點擊
appDelegate.selectedBook = [appDelegate.books objectAtIndex:appDelegate.selectedBookIndex];
appDelegate.selectedChapter = [NSString stringWithFormat:@"%d",appDelegate.selectedChapterIndex];
appDelegate.selectedVerse = [NSString stringWithFormat:@"%d",[sender.titleLabel.text intValue]];
[appDelegate reloadVerses];
ParallelReadViewController *detailViewController = [[ParallelReadViewController alloc] initWithNibName:@"ParallelReadViewController" bundle:nil];
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
[self.navigationController dismissModalViewControllerAnimated:YES];
我怎樣才能解僱表單,並轉到主頁(parallelreadviewcontroller)與相應的詩句?
先嚐試解除模態,然後推動你的視圖控制器。 – rishi 2012-04-26 04:57:41
@RIP我把[self.navigationController dismissModalViewControllerAnimated:YES];上方..ParallelReadViewController * detailViewController = [[ParallelReadViewController alloc] initWithNibName:@「ParallelReadViewController」bundle:nil]; [self.navigationController pushViewController:detailViewController animated:YES]; [detailViewController release]; [self.navigationController dismissModalViewControllerAnimated:YES]; ..但再次崩潰應用程序 – stackiphone 2012-04-26 05:15:21
@RIP有沒有辦法做到這一點? – stackiphone 2012-04-26 05:24:02