0

各セクションに複数のセクションと行がある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;
    }

}

正しいインデックス パスを取得するにはどうすればよいですか??

4

1 に答える 1

0
WeightLiftingInfo *theIndo = [_fetchedResultsController objectAtIndexPath:self.tableView.indexPathForSelectedRow];

これが答えのようです。単一の整数ではなく、セット [x,y] のように見える正しいインデックス パスを提供します。(これは私の解釈であり、間違っている可能性があります)

于 2012-06-20T15:46:54.460 に答える