macOS/iOS API解説

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

目次

dictionaryWithCapacity:

INDEX>Foundation>NSMutableDictionary>

変更可能な辞書を作って返します
+(id)dictionaryWithCapacity:(unsigned)numItems

解説

変更可能な辞書(NSMutableDictionary)を作って返します。
numItemsは初期設定の項目数です。必要があればシステムは自動的にメモリを割り当てます。

返り値

( id )

変更可能な辞書

引数

( unsigned )numItems

初期設定の項目数

クラス

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