windowWithWindowNumber:
指定したウインドウ番号のウインドウオブジェクトを返します
- (NSWindow *)windowWithWindowNumber:(NSInteger)windowNum
func windowWithWindowNumber(_ windowNum: Int) -> NSWindow?
解説
指定したウインドウ番号(windowNum)のウインドウオブジェクト(NSWindow)を返します。
引数
( NSInteger )windowNum
ウインドウ番号
フレームワーク
ApplicationKit
クラス
NSApplication
使用可能
10.0
編集時のバージョン
10.10
参照
例文
#import "Controller.h" @implementation Controller - (IBAction)pushButton:(id)sender { NSLog ([[[NSApplication sharedApplication] windowWithWindowNumber:[myWindow windowNumber]] description]); } @end
//NSApplication windowWithWindowNumber() @IBAction func function027(sender: AnyObject) { //共有アプリケーションインスタンスを取得 let anApplication = MyApplication.sharedApplication() let mainWindow :NSWindow = anApplication.mainWindow! NSLog("window number = %d",anApplication.windowWithWindowNumber(mainWindow.windowNumber)!) }