How to sort NSMutableSet of CLCircularRegion and get the 20 closest?

56 views Asked by At

I have an NSMutableSet of 200 CLCircularRegions and my current location. I want an NSMutableSet of 20 closest CLCircularRegions to my current location. How do I accomplish that in the most efficient way? I'm currently saving each region with calculated closest distance into core data, then fetch by setting the limit to 20 and sorted by distance.

0

There are 0 answers