Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.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
Core data IOS-搜索/筛选后,如何选择RowatineXpath_Core Data_Ios6_Uisplitviewcontroller - Fatal编程技术网

Core data IOS-搜索/筛选后,如何选择RowatineXpath

Core data IOS-搜索/筛选后,如何选择RowatineXpath,core-data,ios6,uisplitviewcontroller,Core Data,Ios6,Uisplitviewcontroller,我有一个splitView应用程序,在那里我安装了搜索/过滤 过滤对主视图有效,但我不知道如何设置“DidSelectRowatineXpath”。似乎根和细节之间的联系已经丢失 我尝试使用以下代码重新连接: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { indexPath = [self.tableView indexPathForSelecte

我有一个splitView应用程序,在那里我安装了搜索/过滤

过滤对主视图有效,但我不知道如何设置“DidSelectRowatineXpath”。似乎根和细节之间的联系已经丢失

我尝试使用以下代码重新连接:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    indexPath = [self.tableView indexPathForSelectedRow];

     if (tableView == self.searchDisplayController.searchResultsTableView)
     {
         self.selectedItem = [self.searchResults objectAtIndex:indexPath];
     }
     else
     {
         self.selectedItem = [self.fetchedResultsController objectAtIndexPath:indexPath];
     }

    detailViewController.item = self.selectedItem;
    [self.detailViewController.tableView reloadData];
但这并没有给我一个例外

如果相反,我使用:

self.selectedItem = [self.searchResults objectAtIndex:indexPath.row];
没有例外,但未捕获详图视图

非常感谢您的帮助。

没有必要(可能是错误的)打电话


因为所选行是作为参数提供给
tableView:didSelectRowAtIndexPath:

的,为什么要调用
indexPath=[self.tableView indexPathForSelectedRow]
而不是使用作为函数参数提供的
indepath
。就这样。。非常感谢。如果你能提出这个答案,我马上就接受。。有时候,第二双眼睛就是所需要的。再次感谢你。。
indexPath = [self.tableView indexPathForSelectedRow];