--
On Stack Overflow a user asked how to receive atmospheric pressure from a weather service. There are various web-based services that an iOS app could employ to accomplish this, but the basic model is probably the same:
- Using
CoreLocation.framework
to let the iOS device determine its location (e.g. latitude and longitude); - Establishing a connection to web-based weather service to retrieve weather information (JSON or XML would be common formats) based upon that geographic information;
- Parsing the response from the web-based weather service; and
- Updating the iOS app user interface with the barometer information.
So, this project illustrates an example of how this might be done. This particular demonstration is retrieving data in JSON format from http://www.wunderground.com/weather/api/ (a sample weather API referenced to in the The Weather Channel's services page). But the basic structure would be similar when retrieving weather information from other services, too (though the details of how the URL is constructed, how the JSON is parsed, etc., will vary, obviously).
Note, this assumes that you have a Wunderground "key id" for your app by visiting http://www.wunderground.com/weather/api/.
--
On 2 December 2012, this was updated to allow zip code search if the CoreLocation.framework
-based look up fails. It should give you a sense of how zip code based searches might work.
--
If you have any questions, do not hesitate to contact me at
Rob Ryan
robert.ryan@mindspring.com
6 November 2012