instantiateNibWithExternalNameTable:
Nibからインスタンスを作成する
-(BOOL)instantiateNibWithExternalNameTable:(NSDictionary *)externalNameTable:
解説
Nibからインスタンスを作成する
返り値
( BOOL )
YES/NO
引数
( NSDictionary * )externalNameTable
フレームワーク
ApplicationKit
クラス
NSNib
Instance Methods
使用可能
10.3
参照
例文
#import "SetImage.h" @implementation SetImage - (IBAction)set:(id)sender { NSURL *url = [NSURL URLWithString:@"MainMenu.nib"];//同階層 NSNib *nib = [ [ NSNib alloc ] initWithContentsOfURL: url ]; //Nib読み込み用 NSMutableArray *muArray = [NSMutableArray arrayWithCapacity:1]; //Nibの設定 NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys: @"NSApplication",@"NSNibOwner",// This should specify the nib file's owner (required) muArray,@"NSNibTopLevelObjects", // This should be an NSMutableArray that will be filled with the top level objects // of the newly instantiated nib (opional) nil]; ([nib instantiateNibWithExternalNameTable:dic]) ? NSLog(@"nib YES") : NSLog(@"nib NO") ; NSLog([nib description]); } @end