I'm trying to implement a feature where I sort a cross-section of music from 
multiple genres with up to two different keys, where the items with a genre 
matching the first key appear first in the collection and items with a genre 
matching the second key appear after the first group in the collection.  All 
songs with a genre not matching the first or second keys can be in any order 
following the first two groups.
 
So I took a look at NSSortDescriptor but it is not apparent to me how I would 
accomplish my goal with this class.  If I sort with it based on the genre key, 
will basically sort them in alphabetical ascending or descending order, not 
what I want.
 
It seems what I really need to do is modify my predicate so that I issue a 
query for the first group.  And then issue another separate query for the 
second group, and finally a third query for the remaining items where the genre 
is not a match for the first or second group.
 
Three queries just to get this sorted collection.  I'm not experienced with 
NSSortDescriptor and I've only used very simple expressions with NSPredicate.  
Is there a way to get what I want with a single Core Data fetch-request?
 
-Michael
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to