• 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: Moral to call [self windowDidLoad] ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Moral to call [self windowDidLoad] ? (From: Leonard Budney <email@hidden>)

  • Prev by Date: Re: NEWBIE: Why use protocols?
  • Next by Date: Re: HTTP server with NetSocket
  • Previous by thread: Moral to call [self windowDidLoad] ?
  • Next by thread: Beware abs function in Core Data
  • Index(es):
    • Date
    • Thread