From eaf701beca5adce15a6863507cdddaf693e54606 Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Wed, 28 Oct 2009 16:24:41 -0700 Subject: [PATCH] Support key paths instead of simple keys in sort descriptors. Match Cocoa's behavior here. --- Foundation/CPSortDescriptor.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Foundation/CPSortDescriptor.j b/Foundation/CPSortDescriptor.j index 415e0b01a..c7b78c840 100755 --- a/Foundation/CPSortDescriptor.j +++ b/Foundation/CPSortDescriptor.j @@ -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]]; } /*!