Skip to content

Commit

Permalink
Support key paths instead of simple keys in sort descriptors. Match C…
Browse files Browse the repository at this point in the history
…ocoa's behavior here.
  • Loading branch information
Ross Boucher committed Oct 28, 2009
1 parent 95b9ea3 commit eaf701b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Foundation/CPSortDescriptor.j
Expand Up @@ -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]];
}

/*!
Expand Down

0 comments on commit eaf701b

Please sign in to comment.