macOS/iOS API解説

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

目次

initWithCapacity:

変更可能なセットオブジェクトを初期化して返します
-(id)initWithCapacity:(unsigned int)numItems:

解説

変更可能なセットオブジェクトを初期化して返します。

返り値

( id )

変更可能なセット

引数

( unsigned int )numItems

初期設定値

クラス

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