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.

Share:
12,092

Related videos on Youtube

xhan
Author by

xhan

wtf? that's cool

Updated on May 15, 2022

Comments

  • xhan
    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
    xhan over 13 years
    thanks for the answer. seems a NSFetchRequest without an NSPredicate works. I'm still testing.