根据经纬度获取天气信息

时间:2014-09-30 22:09:40   收藏:0   阅读:720

        let manager = AFHTTPRequestOperationManager()

        let url = "http://api.openweathermap.org/data/2.5/weather"

        let params = ["lat":latitude, "lon":longitude, "cnt": 0]

        manager.GET(url, parameters: params, success: { (operation: AFHTTPRequestOperation!, respinseObejct: AnyObject!) in

            println("JSON: " + respinseObejct.description!)

            }, failure: {(operation: AFHTTPRequestOperation!, error: NSError!) in

                println("Error" + error.localizedDescription)

                })

原文:http://www.cnblogs.com/scaptain/p/4002672.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!