• 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: Automatically Call a Function
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automatically Call a Function


  • Subject: Re: Automatically Call a Function
  • From: Ken Thomases <email@hidden>
  • Date: Sun, 15 Jun 2008 16:16:23 -0500

On Jun 15, 2008, at 3:59 PM, Philip Lee Bridson wrote:

-(void)applicationDidFinishLaunching:(NSNotification *)notification
{
printf("In Delegate method.\n"); //DEBUG

winCtrl = [[NSWindowController alloc] initWithWindowNibName:@"Window"];

[winCtrl showWindow:self]; //I have also tried [winCtrl showWindow: [winCtrl window]];
}


I have no idea why this does not work, the DEBUG info is printed to stdout and the rest of the code I use all the time so I am honestly none the wiser. I believe the delegate method works otherwise the text would not be printed to stdout but my second window will not display like it is supposed to. I am at a loss.

In the nib, did you connect the "window" outlet of File's Owner to the primary window of the nib? The NSWindowController needs to be informed in this way as to which window it's supposed to control.


You can try logging the "winCtrl" object you get, too, just to make sure it isn't nil for some reason.

Cheers,
Ken

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Automatically Call a Function
      • From: Philip Lee Bridson <email@hidden>
References: 
 >Automatically Call a Function (From: Philip Lee Bridson <email@hidden>)
 >Re: Automatically Call a Function (From: Marcel Weiher <email@hidden>)
 >Re: Automatically Call a Function (From: Philip Lee Bridson <email@hidden>)

  • Prev by Date: Re: NSMutableAttributedString's setBaseWritingDirection problem
  • Next by Date: Re: Automatically Call a Function
  • Previous by thread: Re: Automatically Call a Function
  • Next by thread: Re: Automatically Call a Function
  • Index(es):
    • Date
    • Thread