I am using a fetchresultscontroller
returning distinct results (NSDictionaryResultType
) which has multiple sections and rows in each section. When I use indexPathForSelectedRow
it returns null
. Here is my code:
-(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;
}
}
How do I get the correct index path??