views:

163

answers:

2

Hello. I'd like to build in some weather functionality into my app and I'm going to be using the NOAA weather web service to retrieve the weather information. The NOAA website has a great deal of information on how the data should be requested and how the resulting data is structured. I'm new to iOS development, so I just need a little direction because I'm not sure which APIs I should be using to request and process this data. My questions are...

  1. What's the proper way to request access to the user's location?
  2. If the user allows access to their location, which APIs would I use to access it?
  3. To make an HTTP request to the RESTful webservice, which APIs should I use?
  4. To process/parse the resulting XML data, which API's should I use?

And if anyone can suggest any good examples online that demonstrate any of this functionality, that would also be helpful.

Thanks so much so much in advance for your wisdom!

+4  A: 

For location data, look into CoreLocation
http://developer.apple.com/iphone/library/documentation/CoreLocation/Reference/CoreLocation_Framework/index.html

For HTTP requests I like to use the ASIHTTPRequest class
http://allseeing-i.com/ASIHTTPRequest/

TouchXML makes it easy to work with XML data
http://code.google.com/p/touchcode/wiki/TouchXML

JoshHighland
Thanks, Josh! Quick question, am I allowed to use the 3rd party APIs you suggested (the last two)? I'm still unclear on which outside code Apple will allow me to use without getting my app denied. Thanks again!
BeachRunnerJoe
There is no such restriction. What you're not allowed to do is use **private** APIs. Third party APIs are fine.
Matt Long
Thanks, Matt, good to know. Stupid question, what's the difference between a private API and a 3rd party API? How can I tell if an API is private or not?
BeachRunnerJoe
+2  A: 

Just today, Luke Redpath posted a complete iPhone REST client he wrote. I can't vouch for it, I only saw today that it even exists. But Luke does good work, so I assume it's pretty decent.

See here: http://lukeredpath.co.uk/blog/some-code-that-i-wrote.html

Dan Ray
Thanks, Dan, it works really well so far!
BeachRunnerJoe
Thanks for the kind words Dan. I feel I should mention the following caveats. What is there is well tested and I have confidence in it but the library is still not complete (I haven't implemented DELETE or HEAD yet) and it's also designed to be used with iOS4 only due to its reliance on blocks. Im definitely interested in feedback though, glad its working out for you Joe.
Luke Redpath