Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
你必须使用 NSDate ,
NSDate
首先构造一个带有当前时间的 NSDate 对象
NSDate *today = [NSDate date]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"HH:mm:ss"]; NSString *currentTime = [dateFormatter stringFromDate:today]; [dateFormatter setDateFormat:@"dd.MM.yyyy"]; NSString *currentDate = [dateFormatter stringFromDate:today];
,现在 currentDate 是字符串对象,你可以用 显示它>UILabel 在屏幕上,
currentDate
显示它>UILabel
同样,您可以创建日期并获取下一天的字符串对象......
WeatherAPI
这些不是 iPhone 特定的,而是免费的天气 API。
NOAA REST 接口
示例:http://www.weather.gov/forecasts/xml/sample_products/browser_interface/ndfdXMLclient.php?zipCodeList=90210&product=time-系列&begin=2004-01-01T00:00:00&end=2013-04-21T00:00:00&maxt=maxt&mint=mint
雅虎!天气预报 RSS
示例:http://weather.yahooapis.com/ Forecastrss?p=90210
Google Weather API - 相关文档网址?
示例:http://www.google.com/ig/api?weather=90210
Weather Underground API
示例:http://api.wunderground.com/auto/wui/geo/ GeoLookupXML/index.xml?query=90210
天气频道< /strong> - 需要注册
示例:在 github 上找到示例代码。 用于访问 Weather Channel XML API 的 Ruby gem
WeatherAPI< /strong>(挪威)
示例:http://api .yr.no/weatherapi/locationforecast/1.6/?lat=34;lon=-118
You will have to use NSDate ,
First Construct an NSDate object with current time
Now currentDate is the string object, you can display it with UILabel on screen,
UILabel
likewise you could create date and get the string object for Next day .....
These are not iPhone specific, but free weather APIs.
NOAA REST Interface
Example: http://www.weather.gov/forecasts/xml/sample_products/browser_interface/ndfdXMLclient.php?zipCodeList=90210&product=time-series&begin=2004-01-01T00:00:00&end=2013-04-21T00:00:00&maxt=maxt&mint=mint
Yahoo! Weather Forecast RSS
Example: http://weather.yahooapis.com/forecastrss?p=90210
Google Weather API - documentation URL for this?
Example: http://www.google.com/ig/api?weather=90210
Example: http://api.wunderground.com/auto/wui/geo/GeoLookupXML/index.xml?query=90210
Weather Channel - Requires signup
Example: found sample code at github. Ruby gem for accessing the Weather Channel XML API
WeatherAPI (Norway)
Example: http://api.yr.no/weatherapi/locationforecast/1.6/?lat=34;lon=-118
要在应用程序中显示天气信息,您可以使用以下天气数据源(支持以下格式 XML/JSON/CSV)。
天气 API
您可以使用 TouchXML 来解析 XML(如果数据源返回类型是 XML fromat)。
TouchXML
To display weather information in application you can use the following weather data feed(supports the following formats XML/JSON/CSV).
Weather API
You can use TouchXML for parsing XML(if the data feed return type is XML fromat).
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(2)
你必须使用
NSDate
,首先构造一个带有当前时间的
NSDate
对象,现在
currentDate
是字符串对象,你可以用显示它>UILabel
在屏幕上,同样,您可以创建日期并获取下一天的字符串对象......
WeatherAPI
这些不是 iPhone 特定的,而是免费的天气 API。
NOAA REST 接口
示例:http://www.weather.gov/forecasts/xml/sample_products/browser_interface/ndfdXMLclient.php?zipCodeList=90210&product=time-系列&begin=2004-01-01T00:00:00&end=2013-04-21T00:00:00&maxt=maxt&mint=mint
雅虎!天气预报 RSS
示例:http://weather.yahooapis.com/ Forecastrss?p=90210
Google Weather API - 相关文档网址?
示例:http://www.google.com/ig/api?weather=90210
Weather Underground API
示例:http://api.wunderground.com/auto/wui/geo/ GeoLookupXML/index.xml?query=90210
天气频道< /strong> - 需要注册
示例:在 github 上找到示例代码。 用于访问 Weather Channel XML API 的 Ruby gem
WeatherAPI< /strong>(挪威)
示例:http://api .yr.no/weatherapi/locationforecast/1.6/?lat=34;lon=-118
You will have to use
NSDate
,First Construct an
NSDate
object with current timeNow
currentDate
is the string object, you can display it withUILabel
on screen,likewise you could create date and get the string object for Next day .....
WeatherAPI
These are not iPhone specific, but free weather APIs.
NOAA REST Interface
Example: http://www.weather.gov/forecasts/xml/sample_products/browser_interface/ndfdXMLclient.php?zipCodeList=90210&product=time-series&begin=2004-01-01T00:00:00&end=2013-04-21T00:00:00&maxt=maxt&mint=mint
Yahoo! Weather Forecast RSS
Example: http://weather.yahooapis.com/forecastrss?p=90210
Google Weather API - documentation URL for this?
Example: http://www.google.com/ig/api?weather=90210
Weather Underground API
Example: http://api.wunderground.com/auto/wui/geo/GeoLookupXML/index.xml?query=90210
Weather Channel - Requires signup
Example: found sample code at github. Ruby gem for accessing the Weather Channel XML API
WeatherAPI (Norway)
Example: http://api.yr.no/weatherapi/locationforecast/1.6/?lat=34;lon=-118
要在应用程序中显示天气信息,您可以使用以下天气数据源(支持以下格式 XML/JSON/CSV)。
天气 API
您可以使用 TouchXML 来解析 XML(如果数据源返回类型是 XML fromat)。
TouchXML
To display weather information in application you can use the following weather data feed(supports the following formats XML/JSON/CSV).
Weather API
You can use TouchXML for parsing XML(if the data feed return type is XML fromat).
TouchXML