For a macOS Xcode 11/12 I have the following function in my view controller:
func controlTextDidChange(_ obj: Notification) {
So, I want to identify the TextField/SearchField that triggered the notification.
I have tired to a few things as well as looked in the debugger at obj object but don't see how to do this?
How is this done?
Thanks
func controlTextDidChange(_ obj: Notification) {
So, I want to identify the TextField/SearchField that triggered the notification.
I have tired to a few things as well as looked in the debugger at obj object but don't see how to do this?
How is this done?
Thanks
Historically, NSControls are identified by tag which is an NSInteger. In code you might use a constant to refer to a particular number then use that in your controller.
There's also the NSUserInterfaceItemIdentification protocol from OS X Lion, which takes a string assigned in Interface Builder (or the automatic one, usually of the form _NS:???).
Finally there's the NSAccessibility protocol, which takes a description, title, etc, but is intended to be user-facing.
There's also the NSUserInterfaceItemIdentification protocol from OS X Lion, which takes a string assigned in Interface Builder (or the automatic one, usually of the form _NS:???).
Finally there's the NSAccessibility protocol, which takes a description, title, etc, but is intended to be user-facing.