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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:01:23+00:00 2026-06-08T17:01:23+00:00

I’ve created a UITableView that is entirely composed of four different groupings. Each section/group

  • 0

I’ve created a UITableView that is entirely composed of four different groupings. Each section/group has a different number of rows. I’ve statically added the necessary number of rows and textfields for the bottom three groups. However, I do not know how many rows I will need for the top section/group. I’ve set up the top group as just having one cell in the .xib, but each time the view loads I am going to have to check how many cells I need and then dynamically add the necessary number of rows to the top section.

I’ve looked around StackOverflow and have seen people discussing the insertRowsAtIndexPaths methods, but I haven’t been able to get it to work.

[settingsPageTableView beginUpdates];
[settingsPageTableView insertRowsAtIndexPaths:tempArray withRowAnimation:UITableViewRowAnimationAutomatic];
[settingsPageTableView endUpdates];

Do I need to put some specific code inside of the insertRowsAtIndexPaths methods? I’ve passed in an NSMutableArray as so:

 NSIndexPath *indexPath0 = [NSIndexPath indexPathForRow:1 inSection:0];
    NSMutableArray *tempArray=[NSMutableArray array];
   [tempArray addObject:indexPath0];

If anyone has any knowledge of how to combine static and dynamic cells in one UITableView, it would be extremely appreciated! For anyone that is familiar with the bluetooth page from the general settings on the iPhone, this is exactly what I’m looking to do. It has a variable number of devices show up as well as a static cell containing a UISwitch at the top. Does anyone know how to accomplish this?

Thanks a bunch!

  • 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-08T17:01:24+00:00Added an answer on June 8, 2026 at 5:01 pm

    So here’s the workaround I just figured out. I know for sure there will never be more than 7 cells that I would ever need for that top portion of the UITable View. So then, I am able to just set up those 7 statically in the .xib file. From there I am able to only show the specific number that I need using this:

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    
        switch(section) {
            case 0:  
                //Do a bunch of checking here on how many i actually need. Then, I will just return the required amount. As long as it is less than the number of cells I have statically placed in my .xib, everything works good.
                return 4;
            case 1:
                return 3;
            case 2:
                return 1;
            case 3:
                return 2;
            case 4:
                return 3;
            default:
                return 0;
            }
    //Every case but the first always needs the same amount of cells, so those are no problem.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Basically, what I'm trying to create is a page of div tags, each has
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters
I am doing a simple coin flipping experiment for class that involves flipping a

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.