根据经纬度获取天气信息

        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)

                })

posted on 2014-09-30 20:53  SCaptain  阅读(2043)  评论(0编辑  收藏  举报

导航