macOS/iOS API解説

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

目次

initWithDictionary:

他の辞書から辞書を初期化して返します
-(id)initWithDictionary:(NSDictionary *)otherDictionary

解説

他の辞書(otherDictionary)から辞書を初期化して返します。

返り値

( id )

初期化した辞書

引数

( NSDictionary * )otherDictionary

辞書

クラス

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