0
迅速uploadTaskWithRequest我非常新的快速的,我有以下代碼與didReceiveData
var data : AnyObject
let dict = jsonObject as NSDictionary
do
{
data = try NSJSONSerialization.dataWithJSONObject(dict, options:.PrettyPrinted)
let strData = NSString(data: data as! NSData, encoding: NSUTF8StringEncoding)! as String
data = strData.dataUsingEncoding(NSUTF8StringEncoding)!
let task = defaultSession.uploadTaskWithRequest(request, fromData: data as? NSData,
completionHandler:
{(data,response,error) in
guard let _:NSData = data, let _:NSURLResponse = response where error == nil
else {
return
}
});
task.resume()
}catch{
return resultJson
}
的resultJson對象返回因爲有更多的日期一個空數組被下載,它需要再寄一次我想知道我的天氣可以使用didReceiveData選項在數據下載後返回數據。我在網上搜索代碼,但找不到任何代碼。任何幫助代碼非常感謝。
感謝