I'm working on an app that displays entries in a Core Data table by dollar figure. I sorted my table by a dollar figure attribute. I also use that as the basis for the table index.
At first I made my titles for my table sections strings. But that didn't work. My table index would sort like this:
$10
$100
$25
$5
$50
Instead of this:
$5
$10
$25
$50
$100
So I changed my model to make the section name attribute an integer. I populated the database, and they sort correctly:
5
10
25
50
100
Now I just have to append a dollar sign to the section index title.
I thought I would do something like this...
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {
NSArray *frcSectionTitlesArray = [fetchedResultsController sectionIndexTitles];
NSString *dollarSectionName = [NSString stringWithFormat:@"$%f", frcSectionTitlesArray];
return dollarSectionName;
}
But of course that does't work because I'm dealing with an array, and not a string.
Any ideas?