On Oct 19, 2016, at 00:49 , Gerriet M. Denkmann <g...@mdenkmann.de> 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.

However, you will have to consider related issues such as Sudden App 
Termination and Automatic App Termination. There are mechanism to suppress 
these, if your app is using them, while there are “unsaved changes”, but since 
your AppDelegate doesn’t implement the NSEditor protocols, there may be 
something you need to do manually, if the NSUserDefaultsController doesn’t do 
the right thing automatically.

_______________________________________________

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

Reply via email to