Swift WebKit NSNotification观察员未接收已发布的通知

Swift WebKit NSNotification观察员未接收已发布的通知,swift,nsnotifications,Swift,Nsnotifications,我有一个类,它有一个NSNotification observer,但它没有收到发布的通知 class WebParserOperation: Operation { let myViewController:ViewController let thisURL:URL init(_ myViewController:ViewController, _ thisURL:URL) { self.myViewController = myViewController s

我有一个类,它有一个NSNotification observer,但它没有收到发布的通知

class WebParserOperation: Operation {

let myViewController:ViewController
let thisURL:URL

init(_ myViewController:ViewController, _ thisURL:URL) {
    
    self.myViewController = myViewController
    self.thisURL = thisURL
    
    super.init()
    
    NotificationCenter.default.addObserver(self, selector: #selector(parseDemandPartnerData(notification:)), name: .demandPartnerJSON, object: nil)
    NotificationCenter.default.addObserver(self, selector: #selector(parseDemandPartnerTable(notification:)), name: .demandPartnerTable, object: nil)
}

override func main() {
    myViewController.loadURL(thisURL)
}

@objc private func parseDemandPartnerTable(notification: NSNotification) {
    print("woot!")
    
}

@objc private func parseDemandPartnerData(notification: NSNotification) {
    print("ok!")
    
}


}

extension Notification.Name {
    static let demandPartnerJSON = Notification.Name("dpJSON")
    static let demandPartnerTable = Notification.Name("dpTable")
}
在ViewController中,在调用webView didFinish之后:

func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!)
我调用此函数并发布通知:

func parseWebViewHTML() {
    
    if let webView = webView {
        webView.evaluateJavaScript("document.getElementsByTagName('html')[0].innerHTML") { innerHTML, error in
            
            if let thisHTML = innerHTML as? String {
                NotificationCenter.default.post(name: .demandPartnerJSON, object: nil, userInfo: ["data":thisHTML])
            }
        }
    }
}
我从未收到通知。不知道我做错了什么