I am writing a small Cocoa application for Mac OS, and my goal is to show a window, and then read the pixels on the screen. I already know how to do the latter part, but am having trouble with having the window show up before proceeding. From what I've seen, window updates like the ones triggered by NSWindow's makeKeyAndOrderFront are deferred.
I'm still relatively new to Cocoa, but I basically want to do something like this:
[myWindow makeKeyAndOrderFront:self];
// application blocks right here until the window is actually shown
...
So how do I make that blocking operation happen?