Mac - 让文本框成为第一响应者

[[textfield window] makeFirstResponder:textfield];

 

设置window 的位置。
windowWillLoad:中设置

在 windowDidBecomeMain: 方法中设定 window 现实的位置。

[self.window setFrameOrigin:NSMakePoint(0,0)];
- (IBAction)takeSelectedIndexFrom:(nullable id)sender; 
  设置调用这个方法可以翻页。 NSPagecontrolller

   item.labelConstraint.constant = 20 * self.ibdLayout.widthRatio;
设定 固定的window  如果主window 关闭,使用通知,关闭整个APP
显示如下:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(browserWindowWillClose:) name:NSWindowWillCloseNotification object:browserWindow];

 

posted @ 2016-01-25 14:25  Qingyun_Qearl  阅读(763)  评论(0编辑  收藏  举报