macOS/iOS API解説

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

目次

NSCompareHashTables

2つのハッシュテーブルのエレメントを比較します。同じならYESを返します
BOOL   NSCompareHashTables ( 
        NSHashTable *   table1 , 
        NSHashTable *   table2 );

解説

2つのハッシュテーブルのエレメントを比較します。同じならYESを返します。

返り値

引数

( NSHashTable * )table1
( NSHashTable * )table2

クラス

NSCompareHashTables

Function

使用可能

10.0

参照

NSCreateHashTable
NSCreateHashTableWithZone

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{

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

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


(NSCompareHashTables(hTable1, hTable2))? NSLog(@"YES") :NSLog(@"NO") ; 
}

@end