How to show a Splash UI before App run?

Discussion in 'Mac Programming' started by xiaohuli170, Mar 26, 2009.

  1. macrumors newbie

    Joined:
    Jan 13, 2009
    #1
    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?
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    Make a borderless window (google NSBorderlessWindowMask) and add an NSImageView to it, then show at startup.
     
  3. macrumors 6502a

    GorillaPaws

    Joined:
    Oct 26, 2003
    Location:
    Richmond, VA
    #3
    Would you do this through a custom awakeFromNib? or is there a better strategy?
     
  4. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #4
    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.
     
  5. thread starter macrumors newbie

    Joined:
    Jan 13, 2009
    #5
    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!
     
  6. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #6
    If your app is quitting without you quitting it yourself, then it's probably crashing.
     

Share This Page