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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:45:17+00:00 2026-06-10T14:45:17+00:00

I am working on an iOS json client for a php webservice and for

  • 0

I am working on an iOS json client for a php webservice and for some reason I’m having problems parsing a fairly simple json response from the server. What do I need to do?

Edit
The problem isn’t the parsing so it must be the jsonString I’m sending the webservice.

Basically I need to send this

POST values

app = mark

data = { “01,E1,AT333AT333,9053839719,2012-08-28 14:35:58,2012-08-28 14:35:58,43.154650,-79.3877390,1000,YS3DD55H812035739,1000000,3434” }

The current code is printing null for both strings.

Here’s my method that handles the call to the webservice.

- (IBAction)submitMessage
{
    NSString* apps =@"mark";
    NSString* data = @"01,E1,AT333AT333,9053839719,2012-08-28 14:35:58,2012-08-28 14:35:58,43.154650,-79.3877390,1000,YS3DD55H812035739,1000000,3434";
    NSDictionary* jsonDictionary=[NSDictionary dictionaryWithObject: data forKey:@"data"];
    NSString* jsonString = [jsonDictionary JSONRepresentation];
    self.outPut.text=jsonString;
    NSLog(@"Made it");
    NSURL *url = [NSURL URLWithString:@"http://secure.g4apps.com/g4webservices.php"];
    AFHTTPClient *httpClient=[[AFHTTPClient alloc] initWithBaseURL:url];
    NSDictionary *params =[NSDictionary dictionaryWithObjectsAndKeys:
                           apps,@"app",
                           jsonString,@"smpdata",nil];

    NSMutableURLRequest *request = [httpClient requestWithMethod:@"POST" path:@"g4webservices.php" parameters:params];

    AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request
        success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
            NSLog(@"Response: %@ %@", [JSON valueForKeyPath:@"Status"], [JSON valueForKeyPath:@"Data"]);
            self.outPut2.text = [NSString stringWithFormat:@"response: %@ %@",[JSON valueForKeyPath:@"Status"], [JSON valueForKeyPath:@"Data"]];    }
                        failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error,id JSON){
                                         NSLog(@"[Error]: %@", error);
    }
];

    [operation start];


}

Here’s a sample json response.

{

"Status":"11",
"Data":["AT333AT333,43.1547986,-79.3884892",
"BT343BT343,43.1547986,-79.3884892"]

}
  • 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-10T14:45:19+00:00Added an answer on June 10, 2026 at 2:45 pm

    The problem was the JSON string I was sending. The service was not using key value pairs for the json string it was receiving and I was unable to figure out how to reproduce that in Objective-C.

    Post Variable where as follows
    app=”app_name”
    data={ “Some csv data” }

    What I was able to get Objective C to produce was
    app=”app_name”
    data={ “Data”:{“Some csv data”} }

    So I modified the server to handle what iOS produced and now everythings working. Figure out how to handle the response when the Data array has more than one value.

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

Sidebar

Related Questions

I am working some portion of twitter api, and getting some JSON response using
I am working on iOS Address Book but having some issues, I am referring
I'm working in IOS and trying to pass some content to a web server
I'm just playing with the JSON parser in iOS it's working fine as a
I'm working on iphone application. I downloaded json framework class from the URL JSON
I am using SBJson framework (also known as json-framework) for the iOS. When parsing
I'm working on an iOS application that needs to play some sounds using the
I am working on an iOS application and I am interested to embed some
Working in iOS 5 I have read a list of file names from my
i have implemented code like here but it's not working for iOS 5.0, it

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.