• 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
Reloading a preference window settings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Reloading a preference window settings
      • From: Ryan Bates <email@hidden>
  • Prev by Date: NSWindowDidBecomeMainNotification firing twice?
  • Next by Date: Parameter strings in URLs
  • Previous by thread: Re: NSWindowDidBecomeMainNotification firing twice?
  • Next by thread: Re: Reloading a preference window settings
  • Index(es):
    • Date
    • Thread