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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:51:55+00:00 2026-06-06T19:51:55+00:00

I have a timer which calls the below code to reload a cell in

  • 0

I have a timer which calls the below code to reload a cell in the second section of my grouped UITableView. It works perfectly fine unless I scroll the screen up so that the first section/cell cannot be seen. Once it “springs back” to its correct position, I see that the text which should appear in section 0 has appeared in section 1 and vice-versa.

  [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:0 inSection:1]] withRowAnimation:UITableViewRowAnimationNone];

Does reloadRowsAtIndexPaths or cellForRowAtIndex path work from the top of the full (visible or invisible) cells, or does it only work starting on the cells that are visible on the screen? In other words, does section 0 actually change depending whether it is visible on-screen or not?

What else would cause cellForRowAtIndexPath to load the wrong data into the cells?

  • 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-06T19:51:57+00:00Added an answer on June 6, 2026 at 7:51 pm

    Ok, I played a bit with your project, here are my suggestions:

    As you are adding the button to the cell, remember to remove it when you don’t want use it (when you refresh the cell, basically you create a new cell, and store the second one to reuse, so if you scroll down and then up, you’ll reuse that cell as the cell for the name).

      if (cell == nil) 
      {
           cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
      }  
     [[cell viewWithTag:2] removeFromSuperview]; 
    

    for this to work, you must set the corresponding tag to the button:

      myButton1.tag = 2;
      [cell addSubview:myButton1]; 
    

    And also, add the button directly to the cell, not to the contentView (this just worked for me, I’m not sure why).

    EDIT: I uploaded a fixed version of your project, download it.

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

Sidebar

Related Questions

I have the code below which works fine, steps through the rows pinging each
How can i have timer which runs for every 5 secs continously. below is
I have the following code which works from my 'scorer' class apart from in
Here is the code below I am using the remove cells (which have been
what my code 'below' does is: the client javascript calls a webservice method which
I have a method which calls a method on an integer: def print_time(time =
I have a UITableView which displays about 5 cells at a time, yet in
I have a timer which will be initialized on viewDidLoad, and be released on
I have a Timer which kicks off and does it's job indefinitely in it's
I have a static timer class which will be called by ANY webpage to

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.