Custom sorting with NSFetchedResultController (subclassing NSSortDescriptor)

后端 未结 1 971
感情败类
感情败类 2021-01-02 17:47

I want to provide custom sorting using NSFetchedResultsController and NSSortDescriptor.

As custom sorting via NSSortDescriptor message -(id)initWithKey:ascending:sel

相关标签:
1条回答
  • 2021-01-02 18:29

    In reference to your question and the comments. You are going to need to pull the objects into memory to sort them. Once they are in memory you can use a convenience method to determine distance from a point.

    To decrease the number of objects you pull into memory you could calculate max and min values and then filter on those, reducing the radius of your search before you sort.

    It is not possible to sort on a calculated value unless it is in memory.

    0 讨论(0)
提交回复
热议问题