1、創建NSWindowController prefereces.h .m .xil文件
2、如果xil沒有一起創建,點住xil文件,右鍵file's owner,
outlets - window
preferencing outlets - delegate
都拖到window上面
2、點擊xil中的window,把NSWindow改爲NSPannel,style改爲HUD panel.
3、
prefereces* wnd = [[prefereces alloc]initWithWindowNibName:@"prefereces"];
wnd.contentViewController.view.hidden = NO;
[wnd showWindow:self];
4、如果是arc代碼,wnd會被立即釋放,表現爲wnd一閃後消失