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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:37:17+00:00 2026-06-02T05:37:17+00:00

I am trying to create a table with dynamic data and I’m kind of

  • 0

I am trying to create a table with dynamic data and I’m kind of stuck. Here is how my data is structured :

NSMutableArray *bigArray;

bigArray has many NSDictionary items.

each items has only one entry.

sectionName is the key, NSMutableArray is the value.

There are many objects in the value NSMutableArray.

I tried to explain this as simple as I could, here is the part where I’m stuck.

//easy
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return [bigArray count];
}

//medium
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{    
    // Return the number of rows in the section.
    return [[[[bigArray objectAtIndex:section] allValues] objectAtIndex:0] count];
}

I can’t figure out this part how to implement this method based on my current data structure :

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
   UITableViewCell *cell = [tableView 
                             dequeueReusableCellWithIdentifier:@"MyCell"];

    MyObject *obj = //Need this part


    cell.textLabel.text = obj.name;   

    return cell;

}

Simply put, I’m trying to insert dynamic sections with dynamic data. I’m looking for advice from more experienced developers, how would you tackle this?

  • 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-02T05:37:20+00:00Added an answer on June 2, 2026 at 5:37 am

    Assuming I understood well how your data is structured, here’s how I would do it:

    (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyCell"];
        if (!cell) {
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MyCell"];
        }
    
        //this will get you the dictionary for the section being filled
        NSDictionary *item = [bigArray objectAtIndex:indexPath.section];
        // then the array of object for the section
        NSMutableArray *mutableArray = [item objectForKey:@"sectionName"];
        //you then take the object for the row
        MyObject *obj = [mutableArray objectAtIndex:indexPath.row];
    
        cell.textLabel.text = obj.name;   
    
        return cell;
    }
    

    Don’t forget to set the reuse identifier for the cell prototype in the attributes inspector

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

Sidebar

Related Questions

I'm trying the following: CREATE TABLE Table1 ( RecordNo autonumber, --error here! PersonId varchar(50),
I'm trying to create a table type in sql server 2005. Here is what
I was trying to create a table dynamically and put textboxes in it. Here
I'm using eclipse + android SDK. I'm trying to create a table with data
I am trying to write a query to create a 'table' of data as
can anyone please help me. I am trying to create a dynamic table with
I am trying to create a dynamic table that is being built based on
I'm trying to use Dynamic Data with a entity model that has Abstract class
I am trying to create a dynamic table using php but needed to get
Excuse me for my English. I've been trying to create a dynamic table which

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.