macOS/iOS API解説

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

目次

NSCreateHashTable

デフォルトのゾーンに新しいハッシュテーブルをつくります。
NSHashTable *  NSCreateHashTable ( 
                NSHashTableCallBacks   callBacks , 
                unsigned int   capacity );

解説

デフォルトのゾーンに新しいハッシュテーブルをつくります。

返り値

引数

( NSHashTableCallBacks )callBacks
( unsigned int )capacity

クラス

NSCreateHashTable

Function

使用可能

10.0

参照

NSCopyHashTableWithZone
NSCreateHashTableWithZone

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{

NSHashTable *hTable = NSCreateHashTable(NSNonOwnedPointerHashCallBacks, 10);
NSHashInsert(hTable, @"aaa");
NSHashInsert(hTable, @"bbb");
NSHashInsert(hTable, @"ccc");

NSLog([NSString stringWithFormat:@"%d",sizeof(hTable)]);
NSLog(NSStringFromHashTable(hTable));
}

@end