Core Data: Fetch all entities
12,092
Use an NSFetchRequest
with a nil
predicate and an appropriate NSSortDescriptor
. On iOS, you should be using an NSFetchedResults
controller as the query may return more items that you want in memory at once.
Related videos on Youtube
Comments
-
xhan almost 2 years
I want to know is there an equivalent to the MySQL
SELECT * FROM table ORDER BY sth
to fetch all the results. -
xhan over 13 yearsthanks for the answer. seems a
NSFetchRequest
without anNSPredicate
works. I'm still testing.