这是我第一次尝试使用UINavigationController实现从tableView单元格到另一个tableView的导航,它不适用于我。 我不使用笔尖文件,我有一个简单的tableView,我在我的应用程序中的一个模式对话框中呈现它,它工作正常,现在我将其中的一个单元添加了revealInidcator,使用户可以从一个从另一个列表(tableView)可用的固定数量的选项。为此,我有另一个类,使第二个tableView。现在的问题是从第一个tableview中的单元格(包含披露图标)导航到第二个tableView不做任何事情,没有错误,没有任何东西。我想我设置导航控制器的方式是错误的,代码不属于委托或第二类的数据源。PushViewController什么都不做
在第一TableView中的方法:didSelectRowAtIndexPath方法我试图抓住该行,然后调用第二的tableView这样的:
mySecondViewController *secondVC = [[[mySecondViewController alloc] initWithStyle:UITableViewStyleGrouped ] autorelease];
UINavigationController *navCont = [[UINavigationController alloc] initWithRootViewController: self];//not sure the first controller should act as the root controller?
[navCont pushViewController:secondVC animated:YES]; //it does nothing, no error,...
第二tableViewcontroller类包含所有委托和数据源的方法,以及初始化方法:
- (id)initWithStyle:(UITableViewStyle)style
{
if ((self = [super initWithStyle:style])) {
}
return self;
}
and declared in interface as:
@interface stockOptionViewController : UITableViewController {
}
我试图玩viewDidLoad,但没有帮助。
请帮助我,因为我没有线索,并且找到的所有示例代码均基于使用nib文件。
感谢, 锦
它工作正常。谢谢 – Cam 2012-02-28 17:35:30