這是我第一次嘗試使用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