I'm running a modal window in my application, which works fine. The problem however seems to be dismissing the window.
While the window closes, it takes at least 20 seconds for the application to continue (I show the modal window at startup), but it will continue instantly if I click on its dock icon.
Here's how I close the modal window:
[NSApp stopModal];
[updaterWindow orderOut:self];
[updaterWindow close];
I've tried various things to get the Application to continue faster, such as manually switching to the main run loop and speaking to the main window directly (asking it to become the key window), which all did not work. Same as before, 20 seconds wait or instant load when clicking on the dock icon.
What can cause something like this? I'm really baffled.
Edit:
My modal window is actually created in a really simple way. I run my window as modal:
[NSApp runModalForWindow:updaterWindow];
When I am done with things, I close it:
[NSApp stopModal];
[updaterWindow orderOut:self];
[updaterWindow close];
The window goes away, but it needs a click to the dock icon or anywhere on the screen for the app to continue.
NSApp'srunModalForWindow:. Will check Instruments in a minute. - PripyatApplication Specific Information: abort() called *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Couldn't load plug-in 'com.apple.OpenGLESAnalyzerInstrument''Just great.. - Pripyatmain.m. For example, are you invoking it before you make the primary call toNSApplicationMain(), or if you are starting it within your controller class? - NSGod