2016-11-23 47 views
0
seesion.dataTask(with:request) { (data,res,err) in 
    print("Hello") 
} 

暧昧参考成员“dataTask(附:completionHandler :)我写一些代码使用SWIFT和Xcode中8,但有一些错误

+0

我想我写得对。 –

+1

你见过[this](http://stackoverflow.com/questions/37812286/swift-3-urlsession-shared-ambiguous-reference-to-member-datataskwithcomplet)和[this](http://stackoverflow.com/questions/38718180/ambiguous-reference-to-member-datataskwithcompletionhandler)问题?他们有没有帮助你? – FelixSFD

+0

print(“Hello”) } –

回答

0

您使用此代码

session.dataTask(with:request as URLRequest) { (data,res,err) in 
      print("Hello") 
     } 
+0

是的,这很好,代码可以complie成功。非常感谢你 –