• 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: Can't get window to come to front in awakeFromNib method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't get window to come to front in awakeFromNib method


  • Subject: Re: Can't get window to come to front in awakeFromNib method
  • From: Shawn Erickson <email@hidden>
  • Date: Sat, 6 Dec 2003 10:00:31 -0800

On Dec 6, 2003, at 9:41 AM, Kurt Marek wrote:

I have a setup window that I want to come to the front when an app is
launched for the first time. I thought this would be fairly easy with
the following code:

if ([[NSUserDefaults standardUserDefaults]
objectForKey:@"libraryLocation"]==nil) {
[setupWindow makeKeyAndOrderFront:self];
}

This code is in the awakeFromNib method of my main controller. The
window appears on screen and is made key (it's menu bar text is black),
but it stays behind the main window of my app. What am I doing wrong
here?

Try doing this in applicationDidFinishLaunching: [1] instead.

Your main window is likely marked to be automatically displayed and it is loading up after your controller.

-Shawn

[1] http://developer.apple.com/documentation/Cocoa/Reference/ ApplicationKit/ObjC_classic/Classes/NSApplication.html#//apple_ref/doc/ uid/20000012/CACBHCEH
_______________________________________________
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.
References: 
 >Can't get window to come to front in awakeFromNib method (From: Kurt Marek <email@hidden>)

  • Prev by Date: Socket crash
  • Next by Date: Re: Can't get window to come to front in awakeFromNib method
  • Previous by thread: Can't get window to come to front in awakeFromNib method
  • Next by thread: Re: Can't get window to come to front in awakeFromNib method
  • Index(es):
    • Date
    • Thread