Support key paths instead of simple keys in sort descriptors. Match Cocoa's behavior here.

This commit is contained in:
Ross Boucher committed 2009-10-28 16:24:41 -07:00
1 parent 95b9ea336b
commit eaf701beca
1 file changed
+1 -1
+1 -1
View File
@@ -136,7 +136,7 @@ CPOrderedDescending = 1;
*/
- (CPComparisonResult)compareObject:(id)lhsObject withObject:(id)rhsObject
{
return (_ascending ? 1 : -1) * [[lhsObject valueForKey:_key] performSelector:_selector withObject:[rhsObject valueForKey:_key]];
return (_ascending ? 1 : -1) * [[lhsObject valueForKeyPath:_key] performSelector:_selector withObject:[rhsObject valueForKeyPath:_key]];
}
/*!