美文网首页
MAC:NSViewController

MAC:NSViewController

作者: L柠_檬 | 来源:发表于2016-08-19 16:22 被阅读531次
目录
  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:独立的新窗口

相关文章

网友评论

      本文标题:MAC:NSViewController

      本文链接:https://www.haomeiwen.com/subject/bjmbsttx.html