So does Apple recommend to not use predicates and sort descriptors in an NSFetchRequest?
- by dontWatchMyProfile
From the docs:
To summarize, though, if you execute a
fetch directly, you should typically
not add Objective-C-based predicates
or sort descriptors to the fetch
request. Instead you should apply
these to the results of the fetch. If
you use an array controller, you may
need to subclass NSArrayController so
you can have it not pass the sort
descriptors to the persistent store
and instead do the sorting after your
data has been fetched.
I don't get it. What's wrong with using them on fetch requests? Isn't it stupid to get back a whole big bunch of managed objects just to pick out a 1% of them in memory, leaving 99% garbage floating around? Isn't it much better to only fetch from the persistent store what you really need, in the order you need it? Probably I did get that wrong...