count
セットの要素数を返します
解説
セットの要素数を返します。
返り値
( unsigned int )
整数値
引数
フレームワーク
Foundation
クラス
NSSet
Instance Methods
使用可能
10.0
iOS2.0以降
参照
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSArray *arr = [NSArray arrayWithObjects:@"aaa",@"bbb",@"ccc",nil]; NSSet *set = [NSSet setWithArray:arr]; NSLog([NSString stringWithFormat:@"%d",[set count]]); } @end