Re: observeValueForKeyPath:... called too often in macOS 12
Re: observeValueForKeyPath:... called too often in macOS 12
- Subject: Re: observeValueForKeyPath:... called too often in macOS 12
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Wed, 19 Oct 2016 15:40:54 +0700
> On 19 Oct 2016, at 15:08, Quincey Morris <email@hidden> wrote:
>
> On Oct 19, 2016, at 00:49 , Gerriet M. Denkmann <email@hidden> wrote:
>>
>> Before:
>>
>> TextField1 bound Value to:
>> Shared User Defaults Controller
>> Controller Key = values
>> Model Key Path = TextField1
>>
>> This worked fine.
>
> Yeah, I didn’t realize you were binding to a NSUserDefaultsController. Since that implements NSEditorRegistration and NSEditor, switching to NSObjectController doesn’t improve anything.
>
> The real problem is that it just doesn’t know when you app is about to quit. If you want to save text fields that are still being edited, make sure you invoke one of the NSEditor methods on the NSUserDefaultsController before you quit, e.g. “commitEditing”. That will force it to end editing.
I added:
applicationWillTerminate:
[ NSUserDefaultsController.sharedUserDefaultsController commitEditing ]
which seems to fix this issue (which was clearly a bug in my own code).
Thanks for your help!
Kind regards,
Gerriet.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden