目录
1.1 NSViewController
1.2 NSWindowController
1.1 区别
1.1 NSViewController
KKF *kkf = [[KKF alloc]initWithNibName:@"KKF" bundle:nil];
__weak __typeof(kkf) wkkf = kkf;
kkf.blockHomeViewController = ^(){
[wkkf.presentingViewController dismissViewController:wkkf];
};
[[NSApplication sharedApplication].keyWindow.contentViewController presentViewControllerAsSheet:kkf];
1.2 NSWindowController
(1)创建子类WindowController,继承与NSindowController。
(2)创建新的Window
self.windowController = [[WindowController alloc]initWithWindowNibName:@"WindowController"];
[self.windowController showWindow:self];
一定要定义成全局的
1.3 NSViewController 和 NSWindowController 区别
NSViewController:内部套嵌
NSWindowController:独立的新窗口