Re: Moral to call [self windowDidLoad] ?
Re: Moral to call [self windowDidLoad] ?
- Subject: Re: Moral to call [self windowDidLoad] ?
- From: Daniel Jalkut <email@hidden>
- Date: Wed, 18 May 2005 13:07:40 -0700
No, it's not moral or ethical to abuse windowDidLoad in this way.
Because by definition windowDidLoad is called immediately after
loading a window from a NIB file, it could cause trouble if it's
called at another time.
That said, the default NSWindowController implementation is
documented as doing nothing, so unless you're subclassing from an
existing subclass of NSWindowController, it probably won't cause any
harm.
What I would do instead is add a method "resetControls" or
something, and move all the significant functionality out of
windowDidLoad and into that method. Then just call that method from
your windowDidLoad method and whenever you want to manually do a reset.
Daniel
On May 18, 2005, at 12:54 PM, Leonard Budney wrote:
A simple trick that forces the update is to call [self
windowDidLoad] in the preferencesController object; this forces the
controls to be re-initialized from the default preferences.
The question is, is that moral? Should I be doing this another way?
Thanks!
Len.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
sweater.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden