Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DVR.Session delegate]: unrecognized selector #45

Open
jefflovejapan opened this issue Mar 25, 2016 · 1 comment
Open

[DVR.Session delegate]: unrecognized selector #45

jefflovejapan opened this issue Mar 25, 2016 · 1 comment

Comments

@jefflovejapan
Copy link

I'm trying to use a DVR Session with Alamofire but using it to initialize a Manager generates an unrecognized selector exception.

This conversation deals with my use case, but the advice ("Just create a session delegate, then create your custom session, and pass both in.") doesn't seem to work. Since DVR's Session is a subclass of NSURLSession I would expect that you could ask for its delegate but it's breaking for some reason.

let delegate = Manager.SessionDelegate()
let backingSession = NSURLSession(configuration: NSURLSessionConfiguration.defaultSessionConfiguration(), delegate: delegate, delegateQueue: nil)
let maybeBundle = NSBundle.allBundles().filter{ $0.bundlePath.lowercaseString.containsString("xctest") }.first
if let bundle = maybeBundle {
    let session = Session(outputDirectory: "~/Desktop/DVR/", cassetteName: cassetteName, testBundle: bundle, backingSession: backingSession)
}
@gsholtz
Copy link

gsholtz commented May 31, 2016

I'm having the same issue as @jefflovejapan is having. I created the objects as advised (Session delegate and custom session), but if the moment I instantiate the Alamofire.Manager with both, I get this error: "[DVR.Session delegate]: unrecognized selector sent to instance (instance address)".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants