I just ran into the problem where I was trying
[object valueForKey:key]
when I should have used
[object valueForKeyPath:key]
As a quick fix I did this.
if ([[sortDescriptor key] rangeOfString:@"."].location != NSNotFound ) {
sectionHeader = [object valueForKeyPath:[sortDescriptor key]];
} else {
sectionHeader = [object valueForKey:[sortDescriptor key]];
}
Is this the best way to handle this scenario?