macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

instantiateNibWithOwner:topLevelObjects:

Nibからインスタンスを作成します。
-(BOOL)instantiateNibWithOwner:(id)owner:
     topLevelObjects:(NSArray **) topLevelObjects :

解説

Nibからインスタンスを作成します。

返り値

( BOOL )

YES/NO

引数

( id )owner
( NSArray ** ) topLevelObjects 

フレームワーク

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 instantiateNibWithOwner:self topLevelObjects:&muArray]) ? NSLog(@"nib YES") : NSLog(@"nib NO") ;




NSLog([nib description]);
}

@end