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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:30:13+00:00 2026-05-13T15:30:13+00:00

got a little problem with receiving the contents of a xml file (using TouchXML).

  • 0

got a little problem with receiving the contents of a xml file (using TouchXML).

My first query works very well, looks something like this:

NSString *url = [NSString stringWithFormat:STATION_ID, latitude, longtitude];
CXMLDocument *rssParser = [[CXMLDocument alloc] initWithContentsOfURL:[NSURL URLWithString:url] options:0 error:nil];
NSLog(@"%@",rssParser);

so this log gives me the complete XML file.

after that, in another method im trying the same:

NSString *url = [NSString stringWithFormat:WEATHER_URL, [positionInformation objectForKey:@"stationId"]];
CXMLDocument *rssParser = [[CXMLDocument alloc] initWithContentsOfURL:[NSURL URLWithString:url] options:0 error:nil];
NSLog(@"%@", rssParser);

but the log im getting is (null).
Loggin the URL String gives me the right URL without spaces or something, the URL Log for example looks like this:

NSString *url = [NSString stringWithFormat:WEATHER_URL, [positionInformation objectForKey:@"stationId"]];
NSLog(@"%@", url);

The result in the debugger Console is

http://api.wunderground.com/weatherstation/WXCurrentObXML.asp?ID=KCASUNNY19

looking at this file with my browser seems to be ok. Anybody know whats going wrong?????

I also tried, first to get the content of this URL by stringWithContentsOfURL, but this also not worked.

  • 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-13T15:30:13+00:00Added an answer on May 13, 2026 at 3:30 pm

    This guy was having the same problem: http://www.iphonedevsdk.com/forum/iphone-sdk-development/15963-problem-initwithcontentsofurl.html. Looks like the API at Weather Underground is expecting a user-agent and returning a 500 HTTP response when it doesn’t see one. You can use -initWithData:options:error: on CXMLDocument to pass the data you get using NSMutableURLRequest.

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

Sidebar

Related Questions

I want to using gpg in windows batch scripts and i've got little problem.
Got little problem here. I created dynamic array: m_elements = new struct element*[m_number_of_elements]; for(int
I've got a little problem in my UITableViewCell. Each Custom Cell have an UISwitch
I've got a little problem with UserScripts in Google Chrome, to be precise with
I'm facing a little problem with Primefaces and Facelets . Here's the problem: I
I'm having a silly little problem with Eclipse. I'm trying to install Rational ClearCase
I'm new to Objective-C and have a little bit of problem. I made an
we've got a real confusing problem. We're trying to test an SQL Bulk Load
I've got a tricky problem. I've made a jquery Widget plugin : $.fn.Widget=function(id_place,id_event,options){}; I
I know this isn't a programming question, but since a lot of people here

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.