NSNib:instantiateNibWithExternalNameTable:
Home 目次>ApplicationKit>NSNib
10.3

instantiateNibWithExternalNameTable:

Nibからインスタンスを作成する


-(BOOL) instantiateNibWithExternalNameTable:(NSDictionary *)externalNameTable


【返り値】
   BOOLYES/NO
【パラメータ】
   externalNameTable


【解説】

Nibからインスタンスを作成する



【例文】


#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


(C) 2000-2007 Satoshi Oomori.
[Apple]

Google
Webwww.oomori.com
Apple_Store_40x120

[ad:Usual day in Japan]

この記事を評価してください。 

良い 

間違いがある 説明がわかりにくい 例文がわかりにくい  

Home 目次>ApplicationKit>NSNib
修正日2006.12.26