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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:56:02+00:00 2026-06-05T03:56:02+00:00

here is my data pattern and i want to create an array of sections,

  • 0

here is my data pattern and i want to create an array of sections, in which case, each section will include an array of rows in that section. I looked at the following questions:

  • 2D arrays using NSMutableArray
  • objective-c multi-dimensional array

and a few other posts but could get no result. Can anyone please guide me how to create an array of sections, and each section shall include its own rows.. Thanks in advance

EDIT
I have allready parsed my data, the log result at the pastebin link is an NSDictionary
here is how i fetch&parse it:

 NSString*key1=[ result objectForKey:@"key" ];                
         NSString *s1=[@"http://" stringByAppendingString:server.text];
         NSString *s2=[s1 stringByAppendingString:@"/ipad/button.php"];
         NSURL *url2=[NSURL URLWithString:[s2 stringByAppendingString:[@"?key=" stringByAppendingString:key1]]];

        NSData *data2=[NSData dataWithContentsOfURL:url2];
         result2=[NSJSONSerialization JSONObjectWithData:data2 options:NSJSONReadingMutableContainers error:nil];

The result in pastebin is this: NSLog(@"Result: %@", result2);

  • 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-05T03:56:05+00:00Added an answer on June 5, 2026 at 3:56 am

    Your data is in JSON format, so just use the NSJSONSerialization class to create the array of arrays for you.

    NSString *yourData;
    NSData *data = [yourData dataUsingEncoding:NSUTF8StringEncoding];
    NSArray *arrayOfArrays = [NSJSONSerialization JSONObjectWithData:data 
        options:NSJSONReadingAllowFragments error:nil];
    

    To use your array of sections in a table view, just use the usual table view datasource methods:

    // numberOfSectionsInTableView
    return [array count];
    
    // numberOfRowsInSection
    return [[array objectAtIndex:section] count];
    
    // cellForRowAtIndexPath
    cell.textLabel.text = [[[array objectAtIndex:indexPath.section] 
       objectAtIndex:indexPath.row]
          objectForKey:"name"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm planning a WPF application which will be able to create dynamic data entry
I want to create an application that logs when I have gone jogging and
I'm implimenting my own ApplicationContext class that uses the singleton pattern. I want to
Here is data. X <- 1:10 Y <- rnorm (length(X), 5, 2) ticks <-
Here is data: set.seed(123) mat <- matrix(rnorm(5000, 0.5, 0.2), 50) heatmap (mat) mat[mat >
Data: Here is sample table(TableA) data ID StartTime EndTime 1 2012-03-22 06:00:00.000 2012-03-22 06:30:00.000
I am sending HTTP GET request and receiving data here: ssize_t numBytes = recvfrom(sock,
What I missing about posting to ActionMethods to pull data here ? I need
I'm learning assembly and I have a very basic loop here segment .data msg:
How to remove a trailing blank space in a regex substitution? Here the Data

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.