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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:08:05+00:00 2026-06-03T09:08:05+00:00

I manage to get Json for my server and parse in Xcode , I

  • 0

I manage to get Json for my server and parse in Xcode , I can then convert Json to a object and loaded my uitableview, the problems is my Json have 7 objects ..

you can see the full Json here

2012-05-05 10:45:02.727 passingdata[63856:fb03] array : {
    posts =     {
        Friday =         (
                        {
                GymClass =                 {
                    "CLASS-TYPE2" = "";
                    "CLASS_LEVEL" = "Intro/General";
                    "CLASS_TYPE" = "Muay Thai";
                    "DAY_OF_WEEK" = Friday;
                    TIME = "13:00 - 14:30";
                };
            }
        );
        Monday =         (
                        {
                GymClass =                 {
                    "CLASS-TYPE2" = "Fighters Training";
                    "CLASS_LEVEL" = "Fighters/Advanced/Intermediate";
                    "CLASS_TYPE" = "Muay Thai ";
                    "DAY_OF_WEEK" = Monday;
                    TIME = "09:30 - 11:00";
                };
            }, ......

with this code I can get friday’s “Friday” and display the GymClass info “GymClass” on my table

- (void)fetchedData:(NSData *)responseData { //parse out the json data

    searchResults2 = [NSMutableArray arrayWithCapacity:10];

    NSError* error;
    NSDictionary* dictionary = [NSJSONSerialization JSONObjectWithData:responseData options:kNilOptions error:&error];

    NSLog(@"array : %@",dictionary);
    NSArray *array = [[dictionary objectForKey:@"posts"] objectForKey:@"Friday"]; // retrieve that Day Gym Classes

    if (array == nil) {
        NSLog(@"Expected 'posts' array");
        return;
          }

    for (NSDictionary *resultDict in array) 
    {
        SearchResult *searchResult3;
        searchResult3 = [self parseTrack:resultDict];

        if (searchResult3 != nil) {
           [searchResults2 addObject:searchResult3];
        }        
    }    
    [self.tableView reloadData];
}

- (SearchResult *)parseTrack:(NSDictionary *)dictionary
{
    SearchResult *searchResult1 = [[SearchResult alloc] init];

    searchResult1.classType= [[dictionary objectForKey:@"GymClass"] objectForKey:@"CLASS_TYPE"];
    searchResult1.classLevel= [[dictionary objectForKey:@"GymClass"] objectForKey:@"CLASS_LEVEL"];

    NSLog(@"parse track = %@", searchResult1);
    return searchResult1;
}

I can get the elements for one day but how do I get the Elements for every day (Mon,Tue…Sun)so i can display on my table by sections?

thanks for your help..

  • 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-03T09:08:06+00:00Added an answer on June 3, 2026 at 9:08 am

    Well in your code, you already are doing that:

    NSDictionary* dictionary = [NSJSONSerialization JSONObjectWithData:responseData options:kNilOptions error:&error];
    
    NSLog(@"array : %@",dictionary);
    NSArray *array = [[dictionary objectForKey:@"posts"] objectForKey:@"Friday"]; // retrieve that Day Gym Classes
    

    Wen can start from there to retrieve only the object posts:

    NSDictionary* dictionary = [NSJSONSerialization JSONObjectWithData:responseData options:kNilOptions error:&error];
    NSDictionary *posts = [dictionary objectForKey:@"posts"];
    
    //Iterate over posts
    
    for (NSArray *aDay in posts){
         //Do something 
         NSLog(@"Array: %@", aDay);
    }
    

    Here, i am using Fast Enumeration to iterate over the dictionary, you should check this here.

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

Sidebar

Related Questions

I can't manage to get a proper json response in an asmx web service.
I have refactored working code to use proper objects and now I can't get
I have a manager class, which update json data from web, get values... The
I'm trying to get Django's manage.py to run with modified settings files. I have
I do not manage to get the latitude, longitude from the following json (hold
I have a JSON server (WCF REST) with a JSON POST method that accepts
I'm very new to backbone but I manage to get it working from tutorial.
I managed to get some help from a previous question and I have the
I've been trying various configurations in order to call a simple JSON-RPC server for
I don't manage to get past a simple parser error for quite some time

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.