29 Jun 12
10 Apr 12
A Core Data fetch request with a combination of predicates and sort descriptors is a very flexible mechanism that covers many of the most common queries you might need for retrieving objects. However when you are more interested in querying for specific values such as the minimum or maximum value of an attribute an alternative approach using expressions can be easier and more efficient.
It’s a lot easier to get your data out of Core Data than the documentation will tell you. This simple 1-line fetch will work just as well as Apple’s suggested 10-line approach for most uses.
I use a category for NSManagedObjectContext that adds some nice functionality for creating fetches and executing them purely with code.