osx彈出對話框

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一閃後消失



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章