Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

XCode is not auto completing this methods i did set the delegate for

NSURLSessionTaskDelegate,NSURLSessionDelegate,NSURLSessionDownloadDelegate

but it still not completing so i feel that i am setting the wrong delegates cause thats what xcode do when i set the wrong delegate

URLSession(_:downloadTask:didResumeAtOffset:expectedTotalBytes:)
URLSession(_:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:)
URLSession(_:downloadTask:didFinishDownloadingToURL:)

well whats wrong with swift this time

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
283 views
Welcome To Ask or Share your Answers For Others

1 Answer

If you type this into Playground:

class Downloader : NSObject, NSURLSessionTaskDelegate, NSURLSessionDownloadDelegate {

}

and then start typing inside the class URLS you get all the autocompletion stuff. Try that and if this does not work restart Xcode. Maybe "cleaning" the project will also help.

Please also note that the methods you reference in your question are defined by the NSURLSessionDownloadDelegate, which you did not include.

Sometimes you have to use the up or down arrow key to scroll to the right autocompletion entry.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...