述語を使用してコアデータ内のオブジェクトを検索しています。必要なオブジェクトを正常に見つけることができますが、そのオブジェクトの詳細ビューをプッシュできるように、そのオブジェクトのindexPathも取得する必要があります。現在、オブジェクトを取得するための次のコードがあります。
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
[fetchRequest setEntity:[NSEntityDescription entityForName:@"Ride" inManagedObjectContext:self.managedObjectContext]];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"title = %@ AND addressFull = %@", view.annotation.title, view.annotation.subtitle];
[fetchRequest setPredicate:predicate];
NSMutableArray *sortDescriptors = [NSMutableArray array];
[sortDescriptors addObject:[[[NSSortDescriptor alloc] initWithKey:@"title" ascending:YES] autorelease]];
[sortDescriptors addObject:[[[NSSortDescriptor alloc] initWithKey:@"addressFull" ascending:YES] autorelease]];
[fetchRequest setSortDescriptors:sortDescriptors];
[fetchRequest setReturnsObjectsAsFaults:NO];
[fetchRequest setPropertiesToFetch:[NSArray arrayWithObjects:@"title", @"addressFull", nil]];
NSError *error = nil;
NSArray *fetchedItems = [self.managedObjectContext executeFetchRequest:fetchRequest error:&error];
// Sohow what record we returned
NSLog(@"%@",[fetchedItems objectAtIndex:0]);
したがって、オブジェクトを正しく配列に入れることができます。 しかし、どうすればそのオブジェクトをindexPathに変換できますか?