Instance Method インスタンスメソッド

replaceObjectsInRange:withObjectsFromArray:range:

Replaces the objects in the receiving array specified by one given range with the objects in another array specified by another range. 受け手側の配列の中の一方の与えられた範囲によって指定されるオブジェクトを、別の配列の中の他方の範囲によって指定されるオブジェクトで置き換えます。

Declaration 宣言

- (void)replaceObjectsInRange:(NSRange)range 
         withObjectsFromArray:(NSArray<ObjectType> *)otherArray 
                        range:(NSRange)otherRange;

Parameters パラメータ

aRange

The range of objects to be replaced in (or removed from) the receiving array. 受け手側の配列において置き換えられる(またはそれから除去される)ことになるオブジェクトの範囲。

otherArray

The array of objects from which to select replacements for the objects in aRange. それからaRangeの中のオブジェクトに対する置き換えを選ぶことになる、オブジェクトの配列。

otherRange

The range of objects be selected from otherArray as replacements for the objects in aRange. aRangeの中のオブジェクトに対する置き換えとして、otherArrayから選択されるオブジェクトの範囲。

Discussion 議論

The lengths of aRange and otherRange don’t have to be equal: If aRange is longer than otherRange, the extra objects in the receiving array are removed; if otherRange is longer than aRange, the extra objects from otherArray are inserted into the receiving array. aRangeotherRangeの長さは等しい必要はありません:aRangeotherRangeより長いならば、受け手側の配列の余分なオブジェクトは取り除かれます;otherRangeaRangeより長いならば、otherArrayからの余分なオブジェクトは受け手側の配列へと挿入されます。

See Also 参照

Replacing Objects オブジェクトを置き換える

Related Documentation 関連文書