let url:NSURL = NSURL(string: "http://flash.weather.com.cn/wmaps/xml/shanghai.xml")!
let request:NSURLRequest = NSURLRequest(URL: url)
NSURLConnection.sendAsynchronousRequest(request, queue: NSOperationQueue.mainQueue(), completionHandler: {(response:NSURLResponse?,data:NSData?,error:NSError?) in
if(error==nil || data?.length > nil){
// let testString : String = String(data: data!, encoding: NSUTF8StringEncoding)!
//数据转换为xml类型
let weather = NSXMLParser(data:data!)
weather.delegate = self
weather.parse()
// self.requestContent.text=testString
}
})