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 7960661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:49:04+00:00 2026-06-04T04:49:04+00:00

I have hard coded a loading cell as the last cell of my table

  • 0

I have hard coded a “loading” cell as the last cell of my table view, when this is generated I call some methods to load in new data from a web service, and when I get the response I save the data, dispatch a notification and call reloadData on my table view.

I want to do the same thing but for the first cell of my table.

My table is in function of time, so scrolling down shows you items from later dates, and the idea is to let the user scroll higher and load earlier items.

I can’t seem to successfully set an initial offset to hide this loading cell, because if it is shown then it will begin loading earlier data of course. I am aware of scrollToRowAtIndexPath:atScrollPosition:animated: but I can’t find an appropriate place to call it (with index path: 1:0 row 1 section 0).

As I mentioned before I need to set this visible section before any cells are called to be created.

Has anyone tried this kind of cell at the start of a table view ?

How can I set an initial visible section of my table view before the first cells are even called to be loaded ?

Should I be doing something more fancy here ? Like having a tableviewHeader and when that is shown I insert a row at index path 0:0 which is the loader, and remove it after I reloadTable ?

  • 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-04T04:49:06+00:00Added an answer on June 4, 2026 at 4:49 am

    I used contentInset, not offset in viewDidLoad.

    [self.tableView setContentInset:UIEdgeInsetsMake(-50,0,0,0)];
    

    When row at index path [0,0] is generated I reset the inset, this happens in tableView:cellForRoWAtIndexPath:

    [self.tableView setContentInset:UIEdgeInsetsMake(0,0,0,0)];
    

    Each time before messaging reloadData on the table view I put that inset back on:

    - (void)reload{
        [self.tableView setContentInset:UIEdgeInsetsMake(-50,0,0,0)];
        [self.tableView reloadData];
    }
    

    This means my loading cell is only ever sitting on screen when it’s viewed, when the new data comes in and table reloads I put the offset back.

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

Sidebar

Related Questions

I have something like this hard-coded: private string[,] m_RolesForUser = new string[,] { {John,President,Chair},
I need to have a Win32 application load a hard coded AES-256 key, ideally
I have a view that I'm loading, and my onCreate() method looks like this:
I have a hard coded URL like so: https://bupacouk.bwa.local.internal.bupa.co.uk/cash-plan-quote/quoteAction.do?getBenefitLevelDetails=getBenefitLevelDetails&productPolicyId=7841#a1 When Javascript is enabled i
I have 4 hard coded divs. After the third div I would like to
I have a hard-coded list, each list item of which has an ID. I
I have a C program which has always used hard coded define statements for
Say that I have a DrawingBrush that has three colors hard-coded, i.e. a border,
I have to turn in a hard copy of some code with an assignment.
its a little bit hard to understand. in the header.php i have this code:

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.