Skip to content

[DVR.Session delegate]: unrecognized selector #45

@jefflovejapan

Description

@jefflovejapan

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)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions