initWithContentsOfFile:
パスで指定したプロパティリストのファイルから、辞書を初期化して返します
-(id)initWithContentsOfFile:(NSString *)path
解説
パスで指定したプロパティリストのファイルから読んで、辞書オブジェクトを初期化して返します。初期化できなければnilを返します。
返り値
( id )
初期化した辞書
引数
( NSString * )path
パス
フレームワーク
Foundation
クラス
NSDictionary
Instance Methods
使用可能
10.0
参照
+ dictionaryWithContentsOfFile:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSDictionary *dic =[[NSDictionary alloc] initWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"thelist" ofType: @"dict"]]; NSLog([dic description]); } @end