initWithWindowNibName:
INDEX>AppKit>NSWindowController
Nibファイルからウインドウコントローラを初期化して返します
- (instancetype)initWithWindowNibName:(NSString *)windowNibName
convenience init(windowNibName windowNibName: String)
解説
Nibファイルからウインドウコントローラを初期化して返します。
返り値
NSWindowControllerオブジェクト
Objective-C(instancetype)convenience init(windowNibName windowNibName: String)
引数
ウインドウのNib名
Objective-C(NSString *)windowNibNamewindowNibName: String
フレームワーク
ApplicationKit
クラス
NSWindowController
使用可能
10.0
参照
関連記事(外部サイト)
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { //MyControllerはNSWindowControllerのサブクラス MyController *contoroller = [[sender window] windowController]; MyController *contoroller2 ; contoroller2 = [[MyController alloc] initWithWindowNibName:@"MyDocument"]; [contoroller2 setWindow:otherWindow]; [contoroller2 showWindow:nil]; } @end
//NSWindowContoroller init(windowNibName:) //NSWindowContoroller loadWindow() //NSWindowContoroller showWindow(self) //NSWindowContoroller windowNibPath @IBAction func function002(sender: AnyObject) { //TestWindow.xibからウインドウコントローラーを作成 let newWindowController : NSWindowController = NSWindowController(windowNibName: "TestWindow") //ウインドウをロード newWindowController.loadWindow() //表示 newWindowController.showWindow(self) NSLog("windowNibPath %@",newWindowController.windowNibPath! ) }
更新時のバージョン
OS X 10.10