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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:41:54+00:00 2026-06-10T03:41:54+00:00

{Overviews: [ {AAAA: [ {Generala: sometext, Generalb: sometext, Generalc: sometext} ], BBBB: [ {Generala:

  • 0
{"Overviews":
    [
     {"AAAA": [
               {"Generala": "sometext",
                "Generalb": "sometext",
                "Generalc": "sometext"}
              ],
     "BBBB": [
               {"Generala": "sometext",
                "Generalb": "sometext",
                "Generalc": "sometext"}
              ]
      }
     ]
 }

Hi I used SBJson to parse this json. When I assigned NSArray *json = [jsonObject valueForKey:@”Overviews”];. The hierarchy of data didn’t go well. I used one NSDictionary, 2 NSArray and 1 NSString to parse Generala.

My goal is to parse the data “Generala” like this:

NSDictionary *data = [overviews valueForObject:@"AAAA"];
NSString *generals = [data valueForObject:@"Generala"];

What have I done wrong in the json file? Thanks in advance.

  • 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-10T03:41:56+00:00Added an answer on June 10, 2026 at 3:41 am
    NSArray *dataArray = [overviews objectForKey:@"AAAA"];
    NSDictionary *dataDict = [dataArray objectAtIndex:0];
    NSString *generals = [dataDict objectForKey:@"Generala"];
    

    This will get you to the correct value, But as you can see I had to “Hard code” the index “0”. You would want some logic in there to get to the specific array.

    or Change your json to:

    {"Overviews":
         {"AAAA":
                   {"Generala": "sometext",
                    "Generalb": "sometext",
                    "Generalc": "sometext"},
         "BBBB":
                   {"Generala": "sometext",
                    "Generalb": "sometext",
                    "Generalc": "sometext"}
          }
    }
    

    and use:
    NSDictionary *dataDict = [overviews objectForKey:@”AAAA”];
    NSString *string = [dataDict objectForKey:@”Generala”];

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

Sidebar

Related Questions

Overview I am using CompositeWPF to create an app using C#. This really should
Guava libraries are powerful, but I’m not sure what all the possibilities of this
Overview: I have two text boxes at the top of this form for inputting
Overview This is the scenario: I'm given a value which represents a portion of
I was wondering if anyone could point me to any resources or overviews as
There is a conceptual overview of Blocks objects in objective-c within this Apple reference:
Background: I found this article on JavaWorld, where Allen Holub explains an alternative to
Overview This is calculator Web application On IBM Website about JavaServer Faces Tutorial. I'm
I am using Sunspot to generate alot of my apps indexes and overviews. In
Is this possible or do I have to use WPF. I am new to

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.