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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:40:58+00:00 2026-06-11T09:40:58+00:00

I am populating a UITableView from an array – lets call it sections .

  • 0

I am populating a UITableView from an array – lets call it sections. The numberOfSectionsInTableView returns sections.count, except for a special case – if sections.count is 0, I return 1 (1 is the minimum number of sections that should ever be returned by numberOfSectionsInTableView). I return nil as the section header in this case, so the UITableView looks empty.

When a new item is added to my dataSource, I manually insert a new row. I also check if a new section is required, and if so I add it to sections and insert the new section. But here is where my ‘special case’ causes problems.

When adding the first item, to the first section, I don’t want to add a new section (because there is already one section minimum at all times). So, I just insert the row.

The row animation insertion seems correct, but I get a strange half-loaded header:

enter image description here

All I really need to do is make the UITableView reload the header when the first row is inserted. But I don’t want to lose the insertion animations by simply reloading the tableview or the section.

Any ideas?

  • 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-11T09:40:59+00:00Added an answer on June 11, 2026 at 9:40 am

    I think that you are looking for -reloadSections:withRowAnimation:.

    After you add or remove the special case of section 0, you can call:

    [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationAutomatic];
    

    Hope that helps.

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

Sidebar

Related Questions

When populating a textarea with special characters from a jQuery GET request, the special
I have a UITableView I'm populating with data from CoreData. I have a data
I'm populating my tableview from an array. And this array is created by SQLite
I'm populating an UITableView with MYSQL data from and external DB on my host,so
I have been populating a UITable view cell with the data fetched from a
I am populating a UITableViewController's UITableView through code only. At the bottom of the
Im populating a GridView from List so am forced to use TemplateField controls to
I'm populating a CheckBoxList from database table. As per requirement, all the values should
When populating the queue from the contents of the file, depth does not seem
I have a UITableView. I'm population it from a NSDictionary with arrays for each

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.