• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: observeValueForKeyPath:... called too often in macOS 12
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: observeValueForKeyPath:... called too often in macOS 12 (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: observeValueForKeyPath:... called too often in macOS 12 (From: Quincey Morris <email@hidden>)
 >Re: observeValueForKeyPath:... called too often in macOS 12 (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: observeValueForKeyPath:... called too often in macOS 12 (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: observeValueForKeyPath:... called too often in macOS 12
  • Next by Date: iOS: Preventing a singleton from being deallocated when the app is in the background.
  • Previous by thread: Re: observeValueForKeyPath:... called too often in macOS 12
  • Next by thread: Optimization Level
  • Index(es):
    • Date
    • Thread