我有一個ViewBased應用程序。我在其中一個UIViewControllers上添加了一個UITableView。它顯示了數據,我實現了所有的委託方法等。我的問題是,當我想顯示detailView它只是沒有發生。我的代碼:如何在UIViewController上沒有NavigationController的情況下推送DetailView
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
DetailViewController *detailViewController =[[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
NSLog(@"DidSelectRowAtIndexPath");
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
}
我知道我需要一個navigationController,但我沒有一個和我是不成功的嘗試以編程方式添加一個。我的appDelegate中沒有一個,所以我的問題是我需要添加一個來顯示詳細視圖?如果是的話,請給我一個代碼示例如何做到這一點。 如果不是,還有什麼其他方式?
我是iOS新手,所以我在這裏有點迷路。 請幫忙!
非常感謝!這幫助我!有沒有像使用presentModalViewController一樣從樣本中將它從右向左推的方法? – iPhoneNoob 2012-02-24 23:05:30
你可能會在這裏找到這樣的幫助:http://stackoverflow.com/questions/237310/how-can-i-change-the-animation-style-of-a-modal-uiviewcontroller – 2012-02-24 23:08:59
謝謝!這幫助我很多! – iPhoneNoob 2012-02-24 23:26:23