I have list a of places with coordinates
If users select particular location I want to suggest list of locations nearby using coordinates
I can achieve that by putting loop and searching all the places within the distance from the following code
for(i=0;i<locations.count;i++)
CLLocation *locA = [[CLLocation alloc] initWithLatitude:lat1 longitude:long1];
CLLocation *locB = [[CLLocation alloc] initWithLatitude:lat2 longitude:long2];
CLLocationDistance distance = [locA distanceFromLocation:locB];
// if(distance<10)
//{
//show the pin
// }
But I guess It not a efficient way if we have more locations in the database What I can I do here
Is there any alternative way??