views:

23

answers:

1

trying the solution here: http://stackoverflow.com/questions/1741093?tab=newest#tab-top

I'm using a transient property and the category solution and it seems to be working right up until the index char starts to wrap around to the A's again, not sure why it's doing that, just logging what the category/transient getter is returning for uppercaseFirstLetterOfName.

I'm sorting using the name property and then setting sectionNameKeyPath on the fetchRequest to uppercaseFirstLetterOfName.

The full error is: NSFetchedResultsController ERROR: The fetched object at index 248 has an out of order section name 'Y. Objects must be sorted by section name'

Any ideas where I might have gone wrong or how to even track down the problem?

A: 

I found the problem. Because the sort was producing caps and lower case dups I suppose but the indextitles weren't I got that out of order index/section name:

just added this to the fetch selector:@selector(caseInsensitiveCompare:)

so it is now: NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES selector:@selector(caseInsensitiveCompare:)];

and works cracker jack!

Cricketgeek