Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

xiaohuli170

macrumors newbie
Original poster
Jan 13, 2009
27
0
Now I want to show a splash Ui before App run , but I didn't know how to do with cocoa, somebody can give me some code about it , Thanks very much! The splash ui I think it is a pucture , but how to show it before app running?
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Make a borderless window (google NSBorderlessWindowMask) and add an NSImageView to it, then show at startup.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Would you do this through a custom awakeFromNib? or is there a better strategy?

Usually it's at awakeFromNib or applicationDidFinishLaunching. awakeFromNib should probably be reserved for setting up UI stuff specific to that nib, while applicationDidFinishLaunching is better for general launch tasks. But it's still up to how the app was written.
 

xiaohuli170

macrumors newbie
Original poster
Jan 13, 2009
27
0
First Thank you very much. And I show the window in applicationWillFinishLaunching method use orderFront,then hide it in applicationDidFinishLaunching: use orderOut,Now I found that the mainWindow not to show and the app terminate ,why ? How to do to resolute this question? Thanks!
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
If your app is quitting without you quitting it yourself, then it's probably crashing.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.