I have a problen with NotificationCenter

I work with osx and I have 2 viewcontrollers

first one is a list of items, second one is editing one item


in the first controller, I write:

NotificationCenter.default.addObserver(self, selector: #selector(verbeModifie(_:)), name: .savenom, object: nil)


savenom is defined as following:

extension Notification.Name {

static let savenom = Notification.Name("savenom")

}


and the method verbeModifie as following:

@objc func verbeModifie(_ notification: Notification) {

Swift.print("appel verbe modifie')

}

}



In the second controller, I have a method when the record is modified:

func notifyModifVerbe() {

let info = ["idmot": String(idmot), "idtypemot": String(idtypemot)]

NotificationCenter.default.post(name: .savenom, object: self, userInfo: info)

}


with the debugguer, I verify that notifyModifVerbe is called, but the method "verbeModifie" of the first class is never called.


I work with maxOS 10.13.6 and i have to precise two things:

it worked before, but the two controllers subclass classes I have put in a pod.

did I miss something?

I have a problen with NotificationCenter
 
 
Q