Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/475.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
Ios 解析显示错误信息的.com数据_Ios_Objective C_Xcode - Fatal编程技术网

Ios 解析显示错误信息的.com数据

Ios 解析显示错误信息的.com数据,ios,objective-c,xcode,Ios,Objective C,Xcode,我有这个代码片段,如果我在表视图中单击一组数据,它将告诉我选择了什么数据集: -(void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath{ NSLog(@"cell Tapped"); PFObject *tempObject = [colorsArray objectAtIndex:indexPath.row]; _infoDetailLabel.text = [te

我有这个代码片段,如果我在表视图中单击一组数据,它将告诉我选择了什么数据集:

-(void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath{
NSLog(@"cell Tapped");
PFObject *tempObject = [colorsArray objectAtIndex:indexPath.row];

_infoDetailLabel.text = [tempObject objectForKey:@"name"];
[self animateDetailView];
NSLog(@"%@", tempObject.objectId);
}

唯一的问题是,它在我单击的一行下方显示数据。它也无法识别第一次单击,因此我必须在第一次单击后单击另一次,使其选择一行。

我认为问题在于:

-(void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath{
                                             ^^^
当您*取消*选择行时,将激发委托方法。即:单击第1行,然后单击第2行,您将收到通知,第1行已被取消选择


您可能需要
tableView:didSelectRowAtIndexPath:

我的错误对不起,我今天忙得不可开交我脑子里满是数字…没问题!我以前也犯过同样的错误,这就是我看到它的原因。