magicalpanda/MagicalRecord — pull request #181 by jlenorovitz (2012-06-13 00:12:12+00:00)
Title: Updated MR_requestAllSortedBy methods to handle '+'/'-' flags embedded in the comma-separated sortTerm string for attribute-specific ascending/descending

...n the comma-separated sortTerm string for attribute-specific ascending/descending

The sortTerm string (which could already accept a comma-separated list of attributes) can now parse '+' and '-' characters (optionally) prepended to each attribute so that the sort can be ascending by some attributes and descending by others.

Notes:
- The method-level 'ascending' BOOL argument still has effect as the master, making the '+'/'-' flags relative to the master sort order
- The '+' is strictly optional as ascending is the default if no flag is used
- All legacy behavior of these methods is preserved

EXAMPLE:
sortTerm: @"-golfScore,lastName,+firstName"
would return results sorted first by descending golfScore, then ascending lastName, then ascending firstName

If the method-level 'ascending' BOOL were passed as NO then the sort order would be ascending by golfScore, then descending by lastName, then descending by firstName

Signed-off-by: Joel Lenorovitz