1

I am writing a subclass for NSOperation with swift. However, I met a strange problem.

 class Downloader : NSOperation, NSURLSessionDelegate,    NSURLSessionDownloadDelegate{}

When I add "NSURLSessionDownloadDelegate", it will show an error:"Type 'Downloader'does not conform to protocol 'NSURLSessionDownloadDelegate' " When I delete it, every thing is Ok. Do you know WHY? Thanks, advance!

1
  • 1
    You need to implement the methods marked as required in NSURLSessionDownloadDelegate Commented Jan 18, 2016 at 7:15

1 Answer 1

1

According to apple docs https://developer.apple.com/library/prerelease/ios/documentation/Foundation/Reference/NSURLSessionDownloadDelegate_protocol/index.html

implementing URLSession:downloadTask:didFinishDownloadingToURL: is necessary,

Please make sure that you have implemented it.

Sign up to request clarification or add additional context in comments.

1 Comment

Yeah, It's true. Before I use Object-C, if I don't implement the method, It has no error before compile. Swift is different from Objcet-C. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.