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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:50:16+00:00 2026-06-09T03:50:16+00:00

I am receiving a JSON object like this: {data:null, error:1, error_code:InvalidSID, sid:, num_rows_total:0, last_insert_id:0,

  • 0

I am receiving a JSON object like this:

{"data":null,
 "error":1,
 "error_code":"InvalidSID",
 "sid":"",
 "num_rows_total":0,
 "last_insert_id":0,
 "error_info":"Comment...",
 "error_data":[]}

and JSONKit using this code:

NSString *responseString = [request responseString];
NSDictionary *requestDictionary = [responseString objectFromJSONString];
if([[requestDictionary objectForKey:@"error"] intValue]) {
    if([@"InvalidSID" isEqualToString:[requestDictionary objectForKey:@"error_code"]]) {
        [self.navigationController popViewControllerAnimated:YES];
    }
}

produces such output:

{
data = "<null>";
error = 1;
"error_code" = InvalidSID;
"error_data" = ();
"error_info" = "Comment...";
"last_insert_id" = 0;
"num_rows_total" = 0;
sid = "";
}

The problem is, that this if statement is never called because of missing quotation marks around InvalidSID. Is there any known problem with JSONKit that makes those quotation marks disappear?

  • 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-09T03:50:19+00:00Added an answer on June 9, 2026 at 3:50 am

    You are confusing the “description” output from NSDictionary with the value of a key. You also could have saved yourself a lot of time (that is the time you posted this to the time you get some response) by using some simple detective work.

    I assume that what you call “output” above is the result of

    NSLog(@"%@", requestDictionary);
    

    So after that line try this:

    // Just to be complete
        id ee = [requestDictionary objectForKey:@"error"];
        NSLog(@"error=%@ intValueOfError=%d classOfErrorCode=%@", 
            ee, [ee intValue], NSStringFromClass([ee class]) );
    
    // Where I suspect you may discover something
        id ec = [requestDictionary objectForKey:@"error_code"];
        NSLog(@"errorCode=%@ classOfErrorCode=%@", 
            ec, NSStringFromClass([ec class]) );
    

    We do that since something is obviously wrong here, we want to find out more about the objects we have in hand. I am going to guess if you do the above you will discover something you did not expect.

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

Sidebar

Related Questions

I'm receiving a JSON object with date value like this: {PostingDate:\/Date(1325134800000-0500)\/} And I want
I am receiving a JSON object from a PHP get request. It looks like
I am receiving a JSON object where one of the value is null .
I keep receiving this error... [2012-06-14 11:54:50,072: ERROR/MainProcess] Hard time limit (300s) exceeded for
I am receiving a parse error which is this: Parse error: syntax error, unexpected
I have a controller action that is receiving a complex object via JSON. The
Why is the callback function receiving a XMLHttpRequest object instead of a JSON object?
I am receiving JSON string response from my WCF service. I wanna parse this
I am recieving JSON data in this format:- { sEcho:1, total:1710, aaData:[ [ Help,
FullCalendar supports taking in a JSON object through AJAX for it's events, this can

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.