星空网 > 软件开发 > 操作系统

【代码笔记】获得徐家汇的天气预报

一,代码。

【代码笔记】获得徐家汇的天气预报images/loading.gif' data-original="http://common.cnblogs.com/images/copycode.gif" />
//获得徐家汇的天气预报-(void)getWeatherInfo{    NSError *error;    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://m.weather.com.cn/data/101021200.html" ]];//代码为徐家汇    NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];    NSDictionary *weatherDic = [NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableLeaves error:&error];    NSDictionary *weatherInfo = [weatherDic objectForKey:@"weatherinfo"];    NSLog(@"天气%@",[NSString stringWithFormat:@"\n%@\n%@\n%@\n%@\n%@\n ", [weatherInfo objectForKey:@"city"],[weatherInfo objectForKey:@"date_y"],[weatherInfo objectForKey:@"week"], [weatherInfo objectForKey:@"weather1"], [weatherInfo objectForKey:@"temp1"]]);  }
【代码笔记】获得徐家汇的天气预报

 

二,输出。

天气   徐家汇   2014年3月4日   星期二   小雨转多云   11℃~6℃

 

 


 

原标题:【代码笔记】获得徐家汇的天气预报

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

FBA费用全面上调、销售佣金部分下调,卖家到底何去何从?:https://www.ikjzd.com/articles/112904
喜迎2019圣诞!eBay为客户推出圣诞狂欢新方式!:https://www.ikjzd.com/articles/112906
速卖通大促后店铺遇冷,如何做好流量和订单恢复?:https://www.ikjzd.com/articles/112907
为改善消费者购物体验,Newegg明年将推出两项新规 !:https://www.ikjzd.com/articles/112908
这回英国真的要脱了?:https://www.ikjzd.com/articles/112911
强劲!2020年亚马逊prime会员数量或将快速增长超50%!:https://www.ikjzd.com/articles/112912
长治婚庆女司仪和主持人:https://www.vstour.cn/a/366176.html
北京丰台区水上乐园哪家好玩?:https://www.vstour.cn/a/366177.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流