Skip navigation.
 
mlUnit Tests - mainWindow, keyWindow
FROM : steven Hooley
DATE : Mon Mar 03 14:25:23 2008

When running my application's tests i cannot figure out why the NSWindow and
NSApplication properties relating to the keyWindow and  mainWindow (and
others that depend on them, like NSDocumentController's currentDocument) are
always null.


I have my application configured as the 'Test Host' for it's corresponding
unit test bundle. Building the tests causes the app to launch, finish
launching and run the tests. The app's icon appears in the dock while it is
running and it's runloop runs.  The tests run on the application's main
thread. From a test i can create, display and order an NSWindow but i can
not make it become the mainWindow or the keyWindow.


If i run the application and inject the tests via XCInjectBundle everything
works as expected. Any insight into how and why these two routes differ is
much appreciated.

thanks

Related mailsAuthorDate
No related mails found.