dictionaryWithCapacity:
INDEX>Foundation>NSMutableDictionary>
変更可能な辞書を作って返します
+(id)dictionaryWithCapacity:(unsigned)numItems
解説
変更可能な辞書(NSMutableDictionary)を作って返します。
numItemsは初期設定の項目数です。必要があればシステムは自動的にメモリを割り当てます。
返り値
( id )
変更可能な辞書
引数
( unsigned )numItems
初期設定の項目数
フレームワーク
Foundation
クラス
NSMutableDictionary
Class Methods
使用可能
10.0
参照
+ dictionary (NSDictionary)
+ dictionaryWithContentsOfFile:(NSDictionary)
+ dictionaryWithObjects:forKeys:(NSDictionary)
+ dictionaryWithObjects:forKeys:count:(NSDictionary)
+ dictionaryWithObjectsAndKeys:(NSDictionary)
-initWithCapacity:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSMutableDictionary *aMutableDictionary = [ NSMutableDictionary dictionaryWithCapacity:1 ]; NSLog([aMutableDictionary description]); } @end