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