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一闪后消失



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