Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c didSelectRowAtIndexpath无法正常工作_Objective C_Uitableview_Ios4_Didselectrowatindexpath - Fatal编程技术网

Objective c didSelectRowAtIndexpath无法正常工作

Objective c didSelectRowAtIndexpath无法正常工作,objective-c,uitableview,ios4,didselectrowatindexpath,Objective C,Uitableview,Ios4,Didselectrowatindexpath,我正在使用UITableViewController的一个子类,我需要按下单元格并推送一个新的视图控制器;我尝试了我以前复制和粘贴的代码,但有些东西工作不正常。。。仅当我选择另一行时,我才能推送newViewcontroller。。例如,如果我单击第一行,我可以在单击第二行时推送新的视图控制器。。。我已经设置了委托和数据源。。。我不能处理这个问题。。有什么想法吗?你把didSelectRowAtIndexPath和didSelectRowAtIndexPath弄错了 这个问题对我来说是可以理解的

我正在使用UITableViewController的一个子类,我需要按下单元格并推送一个新的视图控制器;我尝试了我以前复制和粘贴的代码,但有些东西工作不正常。。。仅当我选择另一行时,我才能推送newViewcontroller。。例如,如果我单击第一行,我可以在单击第二行时推送新的视图控制器。。。我已经设置了委托和数据源。。。我不能处理这个问题。。有什么想法吗?

你把
didSelectRowAtIndexPath
didSelectRowAtIndexPath
弄错了

这个问题对我来说是可以理解的,你能更好地解释一下是什么问题吗。。。当用户单击单元格时,我键入了要调用的方法。。。didSelectRowAtindexPath。。。而不是在索引路径中
-(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]; }