简体   繁体   中英

URLSession produces '()', not the expected contextual result type

Any clue why am I getting error "'URLSession' produces '()', not the expected contextual result type 'URLSession'" for the below line -

internalSession = URLSession(configuration: URLSessionConfiguration.default)

在此处输入图片说明

I'm using latest Xcode and swift 3. I have found similar questions & answers on stackoverflow and tried them but they didn't have working/accepted answers.

Please help.

请检查您的 URLSessionTaskDelegate 或 URLSessionDelegate 的委托方法,并尝试按照 swift 3 进行匹配。这对我有用。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM