Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 10th, 2012  |  syntax: None  |  size: 0.76 KB  |  hits: 29  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Having troubles with CXMLDocument parser in iOS
  2. CXMLDocument *parser = [[[CXMLDocument alloc] initWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://free.worldweatheronline.com/feed/weather.ashx?q=%@&includeLocation=yes&format=xml&cc=no&date=2012-01-02&key=8adf0ef591225819113001", query]] options:0 error:nil] autorelease];
  3.  
  4. lowTemp           = [[[[[parser nodesForXPath:@"/data/weather/tempMinF" error:nil] objectAtIndex:0] attributeForName:@"data"] stringValue] integerValue];
  5.        
  6. <data>
  7. <weather>
  8. <tempMinF>4</tempMinF>
  9. </weather>
  10. </data>
  11.        
  12. <xml_api_reply version="1">
  13. <weather module_id="0" tab_id="0" mobile_row="0" mobile_zipped="1" row="0" section="0">
  14. <current_conditions>
  15. <temp_f data="52"/>
  16. </current_conditions>
  17. </weather>
  18. </xml_api_reply>