removeObjectsFromIndices:numIndices:
複数のオブジェクトを取り除きます
-(void)removeObjectsFromIndices:(unsigned *)indices numIndices:(unsigned)count
解説
このメソッドは removeObjectAtIndex:に似ていますが、一回の操作で複数のオブジェクトを除去するときに効率的です。
このメソッドはDOでのリモートオブジェクトには送信できません。
変更可能なオブジェクトのindices番目からcount個の要素を取り除きます。
countが3以上だとエラーが発生します。(10.2)
返り値
( void )
なし
引数
( unsigned * )indices
インデックス
( unsigned )count
カウント
フレームワーク
Foundation
クラス
NSMutableArray
Instance Methods
使用可能
10.0
参照
- initWithCapacity:
- removeObjectAtIndex:
- removeObject:inRange:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { unsigned int i = 0; unsigned int u = 2; NSArray *arr1 = [NSArray arrayWithObjects:@"iti", @"ni",@"san", @"yon",@"go", @"roku",@"nana",@"hati", nil]; NSMutableArray *muArr = [NSMutableArray arrayWithCapacity:1]; [muArr addObjectsFromArray:arr1]; [muArr removeObjectsFromIndices:&i numIndices:u]; NSLog([muArr description]); } @end