Reloading a preference window settings
Reloading a preference window settings
- Subject: Reloading a preference window settings
- From: Steve Palmer <email@hidden>
- Date: Sun, 7 Mar 2004 11:04:52 -0800
I have a simple NSWindowController based preference window that is
displayed with:
if (!preferenceController)
preferenceController = [[PreferenceController alloc] init];
[preferenceController showWindow:self];
In the windowDidLoad method, I'm initializing the controls with their
values from the user defaults. The problem is that windowDidLoad is
only called once after the window controller is allocated. If any of
the user defaults are changed elsewhere in the application, the
preferences won't show the new settings.
So - OK. I added:
[preferenceController initializeSettings];
after showWindow to reload the settings via my own initializeSettings
method each time the window is made visible. This works, but there's an
untidy appearance as the values are drawn in after the window is
visible rather than before.
There doesn't seem to be a windowWillBeMadeVisible method in
NSWindowController so I can set the settings there. What is the
recommended way of updating a preference window settings just before it
is being made visible?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.