I have a UITableView displaying a list of plants in alphabetical sections. Within the app, the user can change the language. When the language is changed, the method:
[self.tableview reloadData];
now displays the same plants in a new language. The problem is that the rows and sections are intact, and still sorted in the alphabetical order of the previous language. I have googled and read up and down stackoverflow to find a solution. The closest I came was:
[[self tableView]reloadData];
NSRange range = NSMakeRange(0, [self numberOfSectionsInTableView:self.tableView]);
NSIndexSet *sections = [NSIndexSet indexSetWithIndexesInRange:range];
[self.tableView reloadSections:sections withRowAnimation:UITableViewRowAnimationFade];
Still, I have to run the tableView through viewdDidLoad
to change the alphabetical sorting.
What is the best way to force a new alphabetial sorting after [[self tableview]reloadData];
?