Change this code:
if (tableView == self.searchDisplayController.searchResultsTableView) {
songs = [searchResults objectAtIndex:indexPath.row];
} else {
songs = [songs objectAtIndex:indexPath.row];
}
MPMediaItem *rowItem = [songs objectAtIndex:indexPath.row];
to this:
MPMediaItem *rowItem;
if (tableView == self.searchDisplayController.searchResultsTableView) {
rowItem = [searchResults objectAtIndex:indexPath.row];
} else {
rowItem = [songs objectAtIndex:indexPath.row];
}