I managed to create an Array of MyLocation objects with their distance property set in the first of 2 tabs in a tabBarController. In my 2nd tab I get it like so in viewDidLoad:
[self setAnnotationsToSort:myDelegate.annotationsToSort];
and right after this line I call this method:
-(void)sort{
NSSortDescriptor *sortDescriptor;
sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"distance" ascending:YES] autorelease];
NSArray *sortDescriptors = [NSArray arrayWithObject:sortDescriptor];
NSArray *sortedArray;
sortedArray = [self.annotationsToSort sortedArrayUsingDescriptors:sortDescriptors];
[self.tableView reloadData];
}
which should sort my Array. However my tableView currently loads with the unsorted version of the Array, self.annotationsToSort. How do I reload the tableView but force it to use the new sortedArray?