I've been trying to invoke a function in a Swift Cocoa application when a user enters something in any NSTextField. The NSTextField's are generated at runtime. Here is my attempt:
func OnUserInput(sender: NSTextfield){
CheckEntry(sender.stringValue)
}
init (){
// Create NSTextField's
//for every NSTextField (nsTextField)
nsTextField.sendAction("OnUserInput:", to: nil)
}
Does anyone know why the function is not invoked?