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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:33:09+00:00 2026-06-11T09:33:09+00:00

I am parsing json and the url is returning an integer value. (e.g. 278)

  • 0

I am parsing json and the url is returning an integer value. (e.g. 278)

-(void) connectionDidFinishLoading: (NSURLConnection *) connection{
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
NSString *responseString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
NSLog(@"JSON Response = %@",responseString);}

when I am printing response in NSLog, it gives out something like this

2012-09-15 18:02:02.091 Web Service[5190:f803] JSON Response = "278"

I don’t want the output in quotes. I want it like

2012-09-15 18:02:02.091 Web Service[5190:f803] JSON Response = 278

how can i achieve this?

JSON

NSString *urlString = [NSString stringWithFormat:@"http://10.5.6.105/ARAPPWS/Service1/InsertEmp/name=%@,phone=%@",name.text,number.text];
    NSURL *addUrl = [NSURL URLWithString:urlString]; 
    NSURLRequest *addRequest = [NSURLRequest requestWithURL:addUrl];
    (void)[NSURLConnection connectionWithRequest:addRequest delegate:self];

-(void) connection: (NSURLConnection *) connection didReceiveResponse:(NSURLResponse *)response
{
jsonData = [[NSMutableData alloc]init];


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

}

-(void) connectionDidFinishLoading: (NSURLConnection *) connection
{
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
responseString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];

[self performSelector:@selector(uploadEmpImg:) withObject:nil afterDelay:1];
}

Thanks in advance.

  • 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-11T09:33:10+00:00Added an answer on June 11, 2026 at 9:33 am

    You can use - [NSString integerValue] to obtain the actual numerical representation of the string:

    NSLog(@"JSON response = %d", [responseString integerValue]);
    

    Edit: the problem is that it returns a JSON fragment – strictly speaking it’s not valid JSON. You can then use

    [responseString substringWithRange:NSMakeRange(1, responseString.length - 2)]
    

    to get the actual string value without the quotes and

    [[responseString substringWithRange:NSMakeRange(1, responseString.length - 2)] intValue]
    

    to get it as an integer.

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

Sidebar

Related Questions

I have some problem with JSON parsing. When I hit URL, I've got JSON
i am using json parsing in my url a very big size images are
I am parsing json from the following url http://www.kaverisoft.com/careers/assignments/android/a1.php with the following code public
i m parsing a json url using SBJSON and everything works fine. the problem
I found this article about parsing JSON response from a URL request i iOS:
Here i am displaying a image where image url is fetched by parsing JSON.
I'm parsing JSON that is contained in an HTML element. Consider this markup: <div
From a previous question on Stackoverflow Iterating through/Parsing JSON Object via JavaScript .... My
I already looked at a similar question here : null pointer exception-parsing json with
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.