Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9089511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:10:00+00:00 2026-06-16T22:10:00+00:00

I have around 2500 records in my SQLite database, each record represents a branch

  • 0

I have around 2500 records in my SQLite database, each record represents a branch of a well known store in our country, I use distanceFromLocation to compare distance between the current user’s location and a given location like this:

CLLocation* storeLocation = [[CLLocation alloc] initWithLatitude:lat longitude:lon];
double distance = [userLocation distanceFromLocation:storeLocation]; 

how to use this piece of code (WITH AN EFFICIENT WAY THAT DOES NOT FREEZE UP THE UI) to find the nearest 5 branches among 2500 lat/lon pairs stored in the local SQLite database ?

EDIT :

the code here is an excellent example of how to calculate the distance between two points on the database level, so it’s very efficient, but however, the code is kinda hard to be implemented ‘coz it accesses SQLite and creates queries manually, anybody provides me with a working sample for that code would be highly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T22:10:01+00:00Added an answer on June 16, 2026 at 10:10 pm

    Check out this (efficient) answer and the comment of Kenny Winker:

    https://stackoverflow.com/a/6828849/1611723

    It was a similar problem and will help you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have around 300 records in some table in mysql database. And I have
We have a set of images, around 2500, that are stored in a local
I have around 150 MySQL databases, I need to export 1 table from each
I have around 100 computers and few workers on each of them. The already
I have around 100thousand rows in a mysql table, where each row has about
I have around 1 million records, witch are for answering questions during 24 days
I have around 6 individual xsd schemas that define one complex type each. I
just looking for some advise. I have a website with around 2500 users -
I have around 100 PDF files (each 1-3 pages long) that are formatted strangely,
I have around 3.5 million records in a particular table in Oracle 10g and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.