Cocoa topmost window
How could I get one of my Cocoa application windows开发者_StackOverflow中文版 to get (and maintain) on top all desktop windows while my apllication stay running?
Have a look at NSWindow's -setLevel: method:
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html#//apple_ref/occ/instm/NSWindow/setLevel:
You have to make the window key and order it to front. Use this
[[myWindowController window] makeKeyAndOrderFront:self];
精彩评论