setWithObjects:count:
オブジェクトの配列と配列数でセットを作って返します
+(id)setWithObjects:(id *)objects count:(unsigned)count
解説
オブジェクトの配列と配列数でセットを作って返します。
返り値
( id )
セットオブジェクト
引数
( id * )objects
オブジェクト
( unsigned )count
カウント
フレームワーク
Foundation
クラス
NSSet
Class Methods
使用可能
10.0
iOS2.0
参照
- set
+ setWithArray:
- setWithObject:
- setWithObjects:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { static const int theCount = 3; NSNumber *valArr[theCount]; int i; for (i = 0; i < theCount; i++) { valArr[i] = [NSNumber numberWithInt:i]; } NSSet *set = [NSSet setWithObjects:(id *)valArr count:theCount]; NSLog([[set allObjects] description]); } @end