I try to to perform a segue to a subclass called "Detail Student" by clicking on the corresponding search result. Unfortunatelly it doesn't work. I cannot figure out why it doesn't work. Here is my code so far:
if (tableView == self.searchDisplayController.searchResultsTableView)
{student = [self.searchResults objectAtIndex:indexPath.row];
NSString *fullname = [NSString stringWithFormat:@"%@ %@", student.vorname, student.name];
cell.textLabel.text = fullname;
cell.detailTextLabel.text = student.hatBetrGrund.name;
DetailStudent *controller = [self.storyboard instantiateViewControllerWithIdentifier :@"DetailStudent"];
controller.delegate = self;
controller.managedObjectContext = self.managedObjectContext;
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
self.selectedStudent = [self.fetchedResultsController objectAtIndexPath:indexPath];
controller.student = self.selectedStudent;
NSLog(@"Wow");
}