iphone - Cannot read XML File -
There is a slight problem getting the content of an XML file (using TouchXML).
My first query works very well, something looks like this:
NSString * url = [NSString stringWithFormat: STATION_ID, latitude, longitude]; CXMLDocument * rssParser = [[CXML Document Alloc] initWithContentsOfURL: [NSURL URLWithString: url] Option: 0 Error: Zero]; NSLog (@ "% @", rssParser);
So this log gives me the full XML file.
Then, in another method, I am trying to:
NSString * Url = [NSString stringWithFormat: WEATHER_URL, [positionInformation objectForKey: @ "stationId"]] ; CXMLDocument * rssParser = [[CXML Document Alloc] initWithContentsOfURL: [NSURL URLWithString: url] Option: 0 Error: Zero]; NSLog (@ "% @", RSS parser);
But the log is getting (empty). The URL string for URL string gives me empty or empty URL without the URL, for example the URL log looks like this:
NSString * url = [NSString stringWithFormat: WEATHER_URL, [ PositionInformation objectForKey: @ "stationId"]]; NSLog (@ "% @", URL);
The result of the debugger console
http://api.wunderground.com/weatherstation/WXCurrentObXML.asp?ID=KCASUNNY19
< / Pre>Looks good with this file with your browser. Anyone know what is going wrong ?????
I tried the string withContentsOfURL first to get the contents of this URL, but it also does not work
This guy had the same problem: It seems that the expectation of the API user agent on the Weather Underground Is doing and is returning the 500 HTTP response when he does not see one.
-initWithData: options: error:
on CXMLDocument to pass the data using.
Comments
Post a Comment