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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:21:22+00:00 2026-05-25T03:21:22+00:00

I have an issue with json parsing -I established a connection to a remote

  • 0

I have an issue with json parsing
-I established a connection to a remote server to receive a json object, which looks like this

2011-08-31 13:23:27.280 WallpaperBackground[731:40b] jsonString:{"photoset":{"id":"72157627554107638", "primary":"6095921496", "owner":"66801517@N05",  "ownername":"Gariya1", "photo":[{"id":"6096223569", "secret":"47081ffe65", "server":"6202", "farm":7, "title":"snakc", "isprimary":"0"}, {"id":"6095921496", "secret":"ea3b2b5076", "server":"6064", "farm":7, "title":"images", "isprimary":"1"},

-In the didReceiveData method, I assigned the json string

code:

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

then I built my dictionary

code:

NSDictionary *results = [jsonString JSONValue];

when i am runing this, In console i am getting these error

 2011-08-31 13:23:27.284 WallpaperBackground[731:40b] -JSONValue failed. Error trace is: (
"Error Domain=org.brautaset.JSON.ErrorDomain Code=5 \"Unescaped control character '0x0'\" UserInfo=0x4e1d670 {NSLocalizedDescription=Unescaped control character '0x0'}",
"Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Object value expected for key: server\" UserInfo=0x4e1d7c0 {NSUnderlyingError=0x4e1d6d0 \"Unescaped control character '0x0'\", NSLocalizedDescription=Object value expected for key: server}",
"Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Expected value while parsing array\" UserInfo=0x4e1d810 {NSUnderlyingError=0x4e1d7a0 \"Object value expected for key: server\", NSLocalizedDescription=Expected value while parsing array}",
"Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Object value expected for key: photo\" UserInfo=0x4e1d8d0 {NSUnderlyingError=0x4e1d890 \"Expected value while parsing array\", NSLocalizedDescription=Object value expected for key: photo}",
"Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Object value expected for key: photoset\" UserInfo=0x4e1d980 {NSUnderlyingError=0x4e1d8b0 \"Object value expected for key: photo\", NSLocalizedDescription=Object value expected for key: photoset}"

If any one knw let me help out pl… thanx

  • 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-25T03:21:23+00:00Added an answer on May 25, 2026 at 3:21 am

    Instantiate a NSMutableData, preferably public in your interface definition found in your .h file.
    Every time connection:didReceiveData: is called, use the NSMutableData's "appendData:data" method to add the newly received data to the variable.

    When your connection:didFinishLoading: method is called, you will have a completely filled NSMutableData object waiting to be parsed.
    Then call the SBJSONParser's method to parse it like you did.

    EDIT

    You declare a NSMutableData object in your .h file.

    Whenever your connection object calls its delegate method DidReceiveData you will append the data as follows:

    - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
    {
        [publicDataObject appendData:data];
    }
    

    When the data is completely downloaded you will be left an object with your complete data in it.
    So then in your finishedLoading method:

    - (void)connectionDidFinishLoading:(NSURLConnection *)connection
    {
        NSString *jsonString = [[NSString alloc] initWithData:publicDataObject encoding:NSUTF8StringEncoding];
    
        id results = [jsonString JSONValue];
    }
    

    If you know for sure what the resulting datatype will be you can change the datatype of the results variable from id to i.e. NSDictionary, or NSArray.

    Hope this helps.

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

Sidebar

Related Questions

I have an issue where if my json file looks like this { Numbers:
I have some JSON I am parsing that looks like this: { dhkplhfnhceodhffomolpfigojocbpcb: {
I have a string of JSON like this: { letterstats:[ {time_taken:636,mistake_letters:,the_letter:L,success:true}, {time_taken:216,mistake_letters:,the_letter:U,success:true}, {time_taken:103,mistake_letters:,the_letter:I,success:true} ],
I am parsing json data. I don't have an issue with parsing and I
I have trouble parsing a json object with perl and I don't know if
I have the same issue as in Excel VBA: Parsed JSON Object Loop but
I have an issue regarding to auto populating a select dropdown from jQuery/JSON data
We have a complex json structure which we need to parse in Android. {
I'm having a bit of an issue with parsing json with python using the
I have a slight issue with parsing data in an array from PHP 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.