【发布时间】:2012-08-25 10:06:55
【问题描述】:
-(void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath{
[super tableView:tableView didSelectRowAtIndexPath:indexPath];
[tableView deselectRowAtIndexPath:indexPath animated:NO];
NSLog(@"selezione");
SitiViewController *sitoSelezionato = [[SitiViewController alloc] init];
sitoSelezionato.title = [[self.objects objectAtIndex:indexPath.row] objectForKey:@"Title"];
sitoSelezionato.url = [NSURL URLWithString:[[self.objects objectAtIndex:indexPath.row] objectForKey:@"URL"]];
[self.navigationController pushViewController:sitoSelezionato
animated:YES]; }
我正在使用 UITableViewController 的一个子类,我需要按下单元格并推送一个新的视图控制器;我尝试了我之前复制和粘贴的代码,但有些东西不能正常工作......只有当我选择另一行时,我才能推送 newViewcontroller.. 例如,如果我单击第一行,我可以在单击时推送新的视图控制器在第二行...我已经设置了委托和数据源...我无法处理这个问题..有什么想法吗???
【问题讨论】:
-
这个问题对我来说是可以理解的,你能更好地解释一下是什么问题吗?
-
收到错误...我输错了用户单击单元格后要调用的方法... didSelectRowAtindexPath ...不是 didDeselectRowAtindexPath
标签: objective-c uitableview ios4 didselectrowatindexpath