iOS Get objects from CoreData sorted by primary key

后端 未结 3 1771
南旧
南旧 2021-01-22 04:29

I have saved data into db using CoreData. I need to fetch data from my table in same order that it was saved. Inside table it is ordered by Z_PK - hidded CoreData key. How can I

3条回答
  •  清歌不尽
    2021-01-22 04:58

    Use a sort descriptor with self as the sort key. The underlying SQL will have ORDER BY t0.Z_PK.

提交回复
热议问题