I have an array and a tableview that gets its data from the array. When I view the tableview on the iPhone, its, ofc, not sorted, and its listed as I have written them.
I wanna sort my array in the tableview, so they aren't listed like this:
- D
- A
- G
- F
- S
but listed like this instead:
- A
- B
- C
- D
- E
- Etc...
How can I do this?
Here is my array:
stationList = [[NSMutableArray alloc] init];
[stationList addObject:@"A"];
[stationList addObject:@"B"];
[stationList addObject:@"C"];
How do I load the array into my tableview array? Loading the array:
NSString *cellValue = [stationList objectAtIndex:indexPath.row];
cell.textLabel.text = cellValue;