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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:40:58+00:00 2026-05-27T21:40:58+00:00

{ id: 1, result: [ { Name: John, Statu: Online }, { Name: Alex,

  • 0
{
"id": "1",
"result": [
{
"Name": "John",
"Statu": "Online"
},
{
"Name": "Alex",
"Statu": "Online"
},
{
"Name": "Diaz",
"Statu": "Offline"
}
]
}

How do i extract each “car” JSON object and put it into a native object? I tried several way but i can’t do that.

    NSString *responseString = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease];

       NSString *responseDict = [responseString JSONValue]; 

       NSArray *objects = [NSArray arrayWithObjects:[responseDict valueForKeyPath:@"result.Name"],[responseDict valueForKeyPath:@"result.Statu"],nil];
       NSLog(@"objects Array: %@",objects);



     **==> NSLOG gives:
                      (
                        (
                        "John",
                        "Alex",
                        "Diaz"
                        ),
                        (
                        "Online",
                        "Online",
                        "Offline"
                        )
                      )



    NSArray *resultsArray = [responseString JSONValue];

     for (NSDictionary *personDict in resultsArray) 
        {

       NSLog(@"ihaleAdi =: %@",[carDict valueForKey:@"result.ihaleAdi"]);

       NSLog(@"ihaleDurum =: %@",[carDict valueForKey:@"result.Statu"]);

       }

But ıt gıves an error tooç I want to just lıst them but ı cant do thatç can anybody help me please? thank you for reading

  • 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-05-27T21:40:59+00:00Added an answer on May 27, 2026 at 9:40 pm

    Use an Array to capture the responseString:

    NSString *responseString = [request responseString];
    NSArray *array = [responseString JSONValue];
    

    Then when you need an individual item from that array use a Dictionary:

    // 0 is the index of the array you need
    NSDictionary *itemDictionary = (NSDictionary *)[array objectAtIndex:0];
    

    Given a JSON responseString that looks like this:

    [{“UniqueID”:111111,”DeviceName”:”DeviceName1″,”Location”:”Device1Loc”,”Description”:”Device1Desc”},{“UniqueID”:22222,”DeviceName”:”DeviceName2″,”Location”:”Device2Loc”,”Description”:”Device2Desc”}]

    You will wind up with an Array that looks like this:

    myArray = (
            {
            Description = "Device1Desc";
            DeviceName = "DeviceName1";
            Location = "Device1Loc";
            UniqueID = 111111;
        },
            {
            Description = "Device2Desc";
            DeviceName = "DeviceName2";
            Location = "Device2Loc";
            UniqueID = 222222;
        }
    )
    

    And a Dictionary of index 0 that looks like this:

    myDictionary = {
        Description = "Device1Desc";
        DeviceName = "DeviceName1";
        Location = "Device1Loc";
        UniqueID = 111111;
    }
    

    Sorry for any confusion and improperly instantiated object earlier. I am still a relative newbie that learned something today.

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

Sidebar

Related Questions

I have a json like this e.result = { 5474: { name: john, last:
Suppose I have a json object that looks like: { id: 1, name: john
Can I store an array such as [1,2,3,4] or some JSON like {name:John Johnson,street:Oslo,
i have data in var description=Name:John;EmployeeID:2;Salary:$8000;Address:London; i want the result as Name: John Employee
<html> <body> <h2>JSON Object Creation in JavaScript</h2> <p> Name: <span id=jname></span><br /> Age: <span
I am trying to parse a json string straight into a managed object. The
I have a table in mysql like this Name Result T1_09_03_2010 fail T2_09_03_2010 pass
How do I name a result group in a Regex? (.Net)
var cityList = from country in doc.Element(result) .Element(cities) .Descendants(city) select new { Name =
I have an xml file like this: <result> <customer> <id>1</id> <name>A</name> </customer> <customer> <id>2</id>

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.