initWithCapacity:
変更可能なセットオブジェクトを初期化して返します
-(id)initWithCapacity:(unsigned int)numItems:
解説
変更可能なセットオブジェクトを初期化して返します。
返り値
( id )
変更可能なセット
引数
( unsigned int )numItems
初期設定値
フレームワーク
Foundation
クラス
NSMutableSet
Instance Methods
使用可能
10.0
参照
+ setWithCapacity:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSMutableSet *set = [[NSMutableSet alloc] initWithCapacity:1]; NSMutableSet *set2 = [NSMutableSet setWithObjects:@"aaa",@"ccc",@"bbb",nil]; NSLog([[set allObjects] description]); if ([set2 isEqualToSet:set]) { NSLog(@"YES"); }else{ NSLog(@"NO"); } } @end