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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:12:37+00:00 2026-06-08T08:12:37+00:00

I have got JSON string as below: {status: ok, secret: d2d388eb3a24aaacb365597f69a2bf97, client: 100006, expires:

  • 0

I have got JSON string as below:

{"status": "ok", "secret": "d2d388eb3a24aaacb365597f69a2bf97", "client": "100006", "expires": "1345721042"}

For parse JSON object I’m using SBJSON library.

This is my code that I have used for retrieve data from JSON object:

SBJsonParser *jsonParser = [[SBJsonParser alloc] init];
NSError *error = nil;
NSArray *jsonObjects = [jsonParser objectWithString:[request responseString] error:&error];

but when I try to out into NSLog my dictionary I have not a pair key value object, but have just key for example: status, secret, client and expires.

How can I get NSDictionary with key value object using SBJSON library

{        
    status = "ok"; 
    secret = "d2d388eb3a24aaacb365597f69a2bf97";
}
  • 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-08T08:12:38+00:00Added an answer on June 8, 2026 at 8:12 am

    It’s because you are setting the result of your parse to a NSArray object. You should store the results of the JSONParser as a NSDictionary object to store it as key value pairs

    NSDictionary *jsonObjects = [jsonParser objectWithString:[request responseString] error:&error];
    

    Then you can access them like so:

    NSString *status = [jsonObjects objectForKey:@"status"];
    NSString *secret = [jsonObjects objectForKey:@"secret"];
    // and so on
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this json string by getting a response from using singleton client(RestKit). [
Using the Newtonsoft.Json library, imagine I have got public class Test { public Object
(I am using json with PHP) Hi i have got a url, from some
I've got the following JSON string to deserialize: [{application_id:1,application_package:abc},{application_id:2,application_package:xyz}] I'm using DataContractJsonSerializer method. It
I have written a PHP script below try to Post the JSON encoded string
I have got below string values in a variable. var mystring = '{img_src:/english/images/spa.jpg, img_title:Enjoy
I have got this result using json decode from an api call. but I
I have got a code from a tutorial How to parse JSON data into
I have queried yahoo finance for historic data and have got JSon output. What
I have a list of places in listview which i got from parsing JSON.

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.