Hi, I wanted to show open file app like Xcode, before opening application's main window.
Tried many ways, but didn't find any luck.
Hi, I wanted to show open file app like Xcode, before opening application's main window.
Tried many ways, but didn't find any luck.
I do this by creating a window (I named splashWindow).
It is defined in the MainMenu.xib and holds labels, images, buttons.
It is connected to its IBOutlet in AppDelegate
@IBOutlet weak fileprivate var splashWindow : NSWindow!
In applicationDidFinishLaunching, I call:
splashWindow.makeKeyAndOrderFront(splashWindow)
From there, the buttons let me select the file to open.
If a file is selected another way, I hide the window.
Well, it's throwing an error in applicationDidFinishLaunching, on line
splashWindow.makeKeyAndOrderFront(splashWindow)
WHich error ?
Did you connect the window from IB to its IBOutlet ?
If you have a way to publish a complete project somewhere or give your email for an instant here, so that we can find what you missed.
Sorry Cluade,
Forgot to add error desciption.
I receive following error:
Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
on line
splashWindow.makeKeyAndOrderFront(splashWindow)
Well, that's probably due to a non connected IBOutlet.
I renew my proposal to find a way to share your demo project.
OK, I figured out why it's not wokring.
I'm not using MainMenu.xib, instead I'm using Main.storyboard
What I want is Show first Splash Window and then Main Window
Plse find demo source at htt ps://github.com/bchandresh/NSWindowDemo
Also note my email address bchandresh@icloud.com