• 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
difference between windowDidLoad and awakeFromNib
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

difference between windowDidLoad and awakeFromNib


  • Subject: difference between windowDidLoad and awakeFromNib
  • From: Hok Chun So <email@hidden>
  • Date: Tue, 16 Jul 2002 16:36:01 +0800

Dear all,

I'd like to know the differences between windowDidLoad in NSWindowController and awakeFromNib.

In the example in Learning Cocoa Chapter 13 P.284, infoWindowViews is released when InfoWindow has been loaded. (please refer the code in the end of this email)

So, the code assume that infoWindowViews has been properly initizlised when the system calls windowDidLoad of InfoWindowController object. Is that true?

Shouldn't the code in windowDidLoad be placed in awakeFromNib so that I am confidence that infoWindowViews has been properly initialised?

Thanks for your help.

Bill
Attached is the code of windowDidLoad

- (void)windowDidLoad
{
[super windowDidLoad];

[notifyView retain];
[notifyView removeFromSuperview];

[reschedView retain];
[reschedView removeFromSuperview];
[notesView retain];

[notesView removeFromSuperview];
[infoWindowViews release];

infoWindowViews = nil;

[infoNotes setDelegate:self];

[self swapInfoWindowView:self];

[self setMainWindow:[NSApp mainWindow]];

[self updateInfoWindow];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(mainWindowChanged:)
name:NSWindowDidBecomeMainNotification object:nil];

// This is a bug fix. See comment at the mainWindowResigned: method.
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(mainWindowResigned:)
name:NSWindowDidResignMainNotification object:nil];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(selectedItemChanged:)
name:ToDoItemChangedNotification object:nil];
}

======================================================
So Hok Chun, Bill
Computer Engineering Student
The University of Hong Kong
_______________________________________________
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.

  • Prev by Date: Re: PBX alternative?
  • Next by Date: Re: PBX alternative?
  • Previous by thread: NSTextView HTML Image Display
  • Next by thread: Re: difference between windowDidLoad and awakeFromNib
  • Index(es):
    • Date
    • Thread