Index: src/OFMutableArray.h ================================================================== --- src/OFMutableArray.h +++ src/OFMutableArray.h @@ -31,17 +31,17 @@ * \param object An object to add */ - (void)addObject: (id)object; /** - * \brief Adds an object to the OFArray at the specified index. + * \brief Inserts an object to the OFArray at the specified index. * * \param object An object to add * \param index The index where the object should be added */ -- (void)addObject: (id)object - atIndex: (size_t)index; +- (void)insertObject: (id)object + atIndex: (size_t)index; /** * \brief Replaces the first object equivalent to the specified object with the * other specified object. * Index: src/OFMutableArray.m ================================================================== --- src/OFMutableArray.m +++ src/OFMutableArray.m @@ -175,16 +175,16 @@ return [[OFArray alloc] initWithArray: self]; } - (void)addObject: (id)object { - [self addObject: object - atIndex: [self count]]; + [self insertObject: object + atIndex: [self count]]; } -- (void)addObject: (id)object - atIndex: (size_t)index +- (void)insertObject: (id)object + atIndex: (size_t)index { @throw [OFNotImplementedException exceptionWithClass: isa selector: _cmd]; } Index: src/OFMutableArray_adjacent.m ================================================================== --- src/OFMutableArray_adjacent.m +++ src/OFMutableArray_adjacent.m @@ -40,12 +40,12 @@ [object retain]; mutations++; } -- (void)addObject: (id)object - atIndex: (size_t)index +- (void)insertObject: (id)object + atIndex: (size_t)index { [array addItem: &object atIndex: index]; [object retain]; Index: tests/OFArrayTests.m ================================================================== --- tests/OFArrayTests.m +++ tests/OFArrayTests.m @@ -57,12 +57,12 @@ [[a[0] description ]isEqual: @"(\n\tFoo,\n\tBar,\n\tBaz\n)"]) TEST(@"-[addObject:]", R([m[0] addObject: c_ary[0]]) && R([m[0] addObject: c_ary[2]])) - TEST(@"-[addObject:atIndex:]", R([m[0] addObject: c_ary[1] - atIndex: 1])) + TEST(@"-[insertObject:atIndex:]", R([m[0] insertObject: c_ary[1] + atIndex: 1])) TEST(@"-[count]", [m[0] count] == 3 && [a[0] count] == 3 && [a[1] count] == 3) TEST(@"-[isEqual:]", [m[0] isEqual: a[0]] && [a[0] isEqual: a[1]])