我有包括的項目作爲一個表視圖(HomeViewController):UITable觀點:didSelectRowAtIndexPath方法爲多行
位置>
報告>
設置>
我能夠做到這與「didselectrowatIndexPath」幫助單行,但當我試圖這樣做與多行(如果其他構造),沒有得到錯誤,但仍然無法點擊任何一個(位置,報告或設置)。我有全部導入.h文件稀土元素above.my代碼:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([[menuList objectAtIndex:indexPath.row] isEqual:@"LOCATIONS"])
{
LocationViewController *locationViewController;
locationViewController = [[LocationViewController alloc] initWithNibName:@"LocationViewController" bundle:nil];
locationViewController.menuList = [menuList objectAtIndex:indexPath.row];
[self.navigationController pushViewController:locationViewController animated:YES];
}
else if([[menuList objectAtIndex:indexPath.row] isEqual:@"REPORTING"])
{
Reporting *reporting;
reporting = [[Reporting alloc] initWithNibName:@"Reporting" bundle:nil];
reporting.menuList = [menuList objectAtIndex:indexPath.row];
[self.navigationController pushViewController:reporting animated:YES];
}
//[locationViewController release];
}
而且要討論關於發佈聲明 幫幫我吧! 謝謝
什麼是LocationViewController和報告的父類? – malinois 2011-03-28 13:47:19
UITableViewDelegate和UITableViewDataSource – Alok 2011-03-28 13:56:45
真的嗎?它不是UINavigationController?我在談論班級,而不是代表。 – malinois 2011-03-28 13:58:48