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

  • SEARCH
  • Home
  • 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 6989925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:16:41+00:00 2026-05-27T19:16:41+00:00

I have read several articles about UITableView, including the official doc and some on

  • 0

I have read several articles about UITableView, including the official doc and some on SO. But my situation seems to be different.
I want to update the Table each time the view loaded. And I must fetch the data using HTTP request.
What I got now is:

  1. When enter the table view, I should use a non-synchronous HTTP request to update the data. Because I don’t want the main thread to wait. One place to do that, is in the tableView:cellForRowAtIndexPath: method. So I return 0 for no data exist at the beginning.
  2. When I get the HTTP respond, I update rows on main thread using beginUpdates endUpdates insertRowsAtIndexPaths:withRowAnimation:
  3. And I must update the “Data Source” at the same time, but how to do that?
    Or should I make a daemon thread and update my data every once in a while? So that the data will be ready when TableView is loaded.
  • 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-05-27T19:16:42+00:00Added an answer on May 27, 2026 at 7:16 pm

    You would do it like this:

    • Have a boolean or some variable where you can reliably detect whether you have all the data.
    • In viewWillAppear, reset everything. Start loading your data.
    • If you don’t have the data yet, you only display one section with one cell (a placeholder cell that reads “Loading…” and shows a spinner, for instance).
    • Once the data is completely loaded, you set the bool or whatever.
    • Call [self.tableView reloadData];

    In all of your UITableViewDataSource methods you would need to check whether you’ve got the data already or not. If not, you return the placeholder data.

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

Sidebar

Related Questions

I feel bad about not getting this. But, although I have read several articles
I have read several articles and several stackoverflow.com posts about expression tree. It is
I've read several articles about push button events in Qt but none seem to
I have lately read several articles and questions about Model Binding and Validation in
I want to enable NSZombies for my iPhone app. I have read several articles
I've read many articles and several post (including here in stackoverflow) but do not
I have read several articles on when to use nested classes, but none that
I have read several documentations about building custom ErrorHandler (by inheriting from IErrorHandler). Unfortunately,
I have read several post on both matters but I haven't seen anyone comparing
I have read through several reviews on Amazon and some books seem outdated. I

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.