> On 30 Nov 2016, at 22:04, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > For #2, you shouldn’t need to use any delegates. Instead, you need to get the > text field to commit its edit. There is an informal protocol for this > (NSEditor), which text fields conform to. > > The problem is that NSWindowController doesn’t implement the other informal > protocol (NSEditorRegistration) that is the way that editors are supposed to > be kept track of. The easiest way to get around this is for your OK button > action to invoke “commitEditing” on the text field. Alternatively, invoke > “commitEditing” from the window delegate's “windowWillClose” method (normally > in the window controller).
This is my main (utility) window so it’s never closed and I don’t use a window controller either. Looks like I need to keep track of the active text field myself. commitEditing sounds better than the insertNewLine trick. Thanks! Jan E. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com