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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:47:59+00:00 2026-06-15T20:47:59+00:00

I am struggling with the following problem: I’ve got an API which returns a

  • 0

I am struggling with the following problem:

I’ve got an API which returns a nested JSON piece.
(I use NSJSONSeralization to parse it)

eg:

 { "thing" = 1,
   "Other thing" = 2,
   "ParentFromList": [{
   "IT" = 3,
   "SecondIT" = 4
 }

How can I use IT and Second it?

I’ve tried:

  NSDictionary *thingy = [[jsonOutput objectForKey:@"ParentFromList"] ObjectForKey:@"IT"];

JsonOutput is also a nsdictionary.
But after running it, it fails with:

  Unrecognized Selector send to instance.

I don’t know how to fix this, help appreciated.

  • 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-15T20:48:01+00:00Added an answer on June 15, 2026 at 8:48 pm

    For your data, the outmost object is a NSDictionary instance. The value for the key ParentFromList is an array, i.e. a NSArrayinstance (note the brackets). The arrays first element contains another dictionary instance (note the curly braces).

    Furthermore, it’s not ObjectForKey: but objectForKey: (case matters).

    So you probably want to write:

    NSDictionary *thingy = [ [ [jsonOutput objectForKey: @"ParentFromList"]
                             objectAtIndex: 0]
                           objectForKey: @"IT"];
    

    BTW: Your sample JSON data is both incomplete and not in JSON format (it’s Apple’s property list format).

    The correct and complete JSON representation would be:

    {
        "thing": 1,
        "Other thing": 2,
        "ParentFromList": [
            {
                "IT": 3,
                "SecondIT": 4
            }
        ]
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm struggling with the following problem concerning primary ids within mysql: I got an
I'm struggling with the following problem. I use the jQuery autocomplete plugin to get
I have searched/Googled around but I'm struggling with the following problem. I am building
I'm struggling with the following scenario and could use some different perspectives to shed
I'm struggling with the following code. Basically, I have a class Foo and nested
Struggling with the following problem. I have an attribute that defines the name of
Hi I'm struggling with the following problem. I have two tables one with employee
I am currently struggling with the following problem. I have successfully installed Apache2 and
Struggling with the following SQL problem. Assume a three dimensional table with entries (h,t,q)
I'm struggling to understand why the following problem appears. I have an input box

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.