So does Apple recommend to not use predicates and sort descriptors in an NSFetchRequest?
Posted
by dontWatchMyProfile
on Stack Overflow
See other posts from Stack Overflow
or by dontWatchMyProfile
Published on 2010-06-12T09:54:40Z
Indexed on
2010/06/12
10:03 UTC
Read the original article
Hit count: 322
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...
© Stack Overflow or respective owner