【问题标题】:didSelectRowAtIndexpath work not prorelydidSelectRowAtIndexpath 工作不正常
【发布时间】: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


【解决方案1】:

您将didSelectRowAtIndexPath 误认为didDeselectRowAtIndexPath

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-09-23
    • 2020-04-23
    • 2023-04-10
    • 2015-01-16
    • 1970-01-01
    • 2016-08-02
    • 2020-02-18
    相关资源
    最近更新 更多