NSTextField in NSPopOver beeping instead of sending action to target (document)

54 Views Asked by At

I have a document-based Cocoa (Mac)/Objective-C application. I'm showing a popover on one of the views in my document window's view; the popover contains only an NSTextField, whose target is the first responder (I have also tried wiring it directly to the File's Owner, which is the document) and whose action is a selector that my NSDocument subclass responds to.

Problem is, when I press return in my field, it just beeps at me. It does not appear to send the action to the document. The document certainly doesn't receive it.

(I can type into the field just fine, but when I want to send the field's action, it refuses.)

There are no exceptions logged in the debugger console.

I have confirmed (by breaking in the debugger in validateUserInterfaceItem: and then opening a menu) that the field's target and action are set as expected. I did a Find using the selector reported by the debugger in my document class to confirm that the selector is indeed correct (no typos).

I'll note that validateUserInterfaceItem: isn't called on the return key-press. I don't remember whether it's supposed to get called by text fields or not.

0

There are 0 best solutions below