我正在使用fetchresultscontroller
返回的不同结果 ( NSDictionaryResultType
),它在每个部分中有多个部分和行。当我使用indexPathForSelectedRow
它时返回null
. 这是我的代码:
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"toDetailViewSeg"]){
WLDetailTableViewController *detailController =segue.destinationViewController;
WeightLiftingInfo *theInfo = [[_fetchedResultsController fetchedObjects] objectAtIndex:self.tableView.indexPathForSelectedRow.row];
detailController.muscleGroupInfo = [theInfo valueForKey:@"muscleGroup"];
detailController.specificExerciseInfo = [theInfo valueForKey:@"specificExercise"];
detailController.managedObjectContext = _managedObjectContext;
}
}
如何获得正确的索引路径?