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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:37:27+00:00 2026-06-11T05:37:27+00:00

im new to parsing JSON and im trying a simple task, to retrieve a

  • 0

im new to parsing JSON and im trying a simple task, to retrieve a URL from a forecast weather json file.

Here i parse the json and i NSLog the contents of each component of the data:

NSError *myError = nil;
NSDictionary *res = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingMutableLeaves  error:&myError];

NSArray *data =  [res objectForKey:@"data"];
NSLog(@"data=%@",data);

NSArray *results =  [data valueForKey:@"weather"];
NSLog(@"weather=%@",results);

NSArray *results1 =  [results valueForKey:@"tempMaxC"];
NSLog(@"tempMaxC=%@",results1);

NSArray *results2 =  [results1 valueForKey:@"weatherIconUrl"];
NSLog(@"weatherIconUrl=%@",results2);

The problem is that when i get the WeatherIconUrl it comes with this format

"http://www.worldweatheronline.com/images/wsymbols01_png_64/wsymbol_0001_sunny.png"

and i cant get the url itself without the quotation marks, i tried using nsrange and componentsSeparatedByString but it always gives me this error:

[__NSArrayI componentsSeparatedByString:]: unrecognized selector sent to instance 

JSON from server:

{
    "data": {
        "current_condition": [
            {
                "cloudcover": "0",
                "humidity": "73",
                "observation_time": "12:19 PM",
                "precipMM": "0.0",
                "pressure": "1021",
                "temp_C": "23",
                "temp_F": "73",
                "visibility": "10",
                "weatherCode": "113",
                "weatherDesc": [
                    {
                        "value": "Sunny"
                    }
                ],
                "weatherIconUrl": [
                    {
                        "value": "http://www.worldweatheronline.com/images/wsymbols01_png_64/wsymbol_0001_sunny.png"
                    }
                ],
                "winddir16Point": "NW",
                "winddirDegree": "320",
                "windspeedKmph": "17",
                "windspeedMiles": "11"
            }
        ],
        "request": [
            {
                "query": "Fanzeres, Portugal",
                "type": "City"
            }
        ],
        "weather": [
            {
                "date": "2012-09-12",
                "precipMM": "0.0",
                "tempMaxC": "28",
                "tempMaxF": "83",
                "tempMinC": "17",
                "tempMinF": "63",
                "weatherCode": "113",
                "weatherDesc": [
                    {
                        "value": "Sunny"
                    }
                ],
                "weatherIconUrl": [
                    {
                        "value": "http://www.worldweatheronline.com/images/wsymbols01_png_64/wsymbol_0001_sunny.png"
                    }
                ],
                "winddir16Point": "NW",
                "winddirDegree": "312",
                "winddirection": "NW",
                "windspeedKmph": "16",
                "windspeedMiles": "10"
            },
            {
                "date": "2012-09-13",
                "precipMM": "0.0",
                "tempMaxC": "33",
                "tempMaxF": "91",
                "tempMinC": "17",
                "tempMinF": "63",
                "weatherCode": "113",
                "weatherDesc": [
                    {
                        "value": "Sunny"
                    }
                ],
                "weatherIconUrl": [
                    {
                        "value": "http://www.worldweatheronline.com/images/wsymbols01_png_64/wsymbol_0001_sunny.png"
                    }
                ],
                "winddir16Point": "N",
                "winddirDegree": "8",
                "winddirection": "N",
                "windspeedKmph": "10",
                "windspeedMiles": "6"
            }
        ]
    }
}

Sorry for my bad english and please correct me if im doing this wrong, 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-11T05:37:28+00:00Added an answer on June 11, 2026 at 5:37 am

    If you truly have quotes surrounding your URL, then try something like this:

    NSString *someURLString = [results2 objectAtIndex:0];
    NSString *quotesRemoved = [someURLString stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"\""]];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to parse a simple JSON file. I'm very new to javascript, JSON,
I'm trying to parse a simple JSON file. I'm very new to javascript, JSON,
I'm trying to work on a new project parsing some JSON data for a
I am trying to retrieve the values from the following url: http://rentopoly.com/ajax.php?query=Bo . I
I am trying to download some JSON from the google book API. The URL
I am trying to use JSON and HTTP client to retrieve data from a
I'm new to iOS development. What I'm trying to do is parse a JSON
I'm new to JS / AJAX and JSON parsing. I've been trying to debug
I'm trying to use JSON parsing from RestKit, but I'm receiving the following compile
I'm new to DOM parsing in PHP: I have a HTML file that I'm

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.