initWithWindowNibPath:owner:
Nibパスとオーナーオブジェクトでウインドウコントローラを初期化して返します
-(id)initWithWindowNibPath:(NSString *)windowNibPath: owner:(id)owner:
解説
Nibファイルパスとオーナーオブジェクトからウインドウコントローラを初期化して返します。
返り値
( id )
NSWindowControllerオブジェクト
引数
( NSString * )windowNibPath
Nibファイルパス
( id )owner
オーナーオブジェクト
フレームワーク
ApplicationKit
クラス
NSWindowController
Instance Methods
使用可能
10.0
参照
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { //MyControllerはNSWindowControllerのサブクラス NSString *path; MyController *contoroller = [[sender window] windowController]; MyController *contoroller2 ; path = [[[NSBundle mainBundle] pathForResource:@"English" ofType:@"lproj"] stringByAppendingPathComponent:@"MyDocument.nib"]; NSLog([[contoroller owner] className]); contoroller2 = [[MyController alloc] initWithWindowNibPath:path owner:[contoroller owner]]; [contoroller2 setWindow:otherWindow]; [contoroller2 showWindow:nil]; } @end