initWithDictionary:
他の辞書から辞書を初期化して返します
-(id)initWithDictionary:(NSDictionary *)otherDictionary
解説
他の辞書(otherDictionary)から辞書を初期化して返します。
返り値
( id )
初期化した辞書
引数
( NSDictionary * )otherDictionary
辞書
フレームワーク
Foundation
クラス
NSDictionary
Instance Methods
使用可能
10.0
参照
+ dictionaryWithDictionary:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSDictionary *dic1 = [NSDictionary dictionaryWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"thelist" ofType: @"dict"]]; NSDictionary *dic2 = [[NSDictionary alloc] initWithDictionary:dic1]; NSLog([dic2 description]); } @end