0

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.

iamarnold
  • 705
  • 1
  • 8
  • 22
  • 1
    Your solution sounds fine, except I would not store them in Core Data, but simply hold them in an array. – fishinear Jan 26 '16 at 05:28
  • It seems the right way to do it, except that NS(Mutable)Set arena ordered, so no sort really, just the 20 closest. – Larme Jan 26 '16 at 10:14

0 Answers0