Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -286,10 +286,18 @@ * \param array The array with objects to add * \return A new array with the objects from the specified array added */ - (OFArray*)arrayByAddingObjectsFromArray: (OFArray*)array; +/** + * \brief Creates a new array with the specified object removed. + * + * \param object The object to remove + * \return A new array with the specified object removed + */ +- (OFArray*)arrayByRemovingObject: (id)object; + #ifdef OF_HAVE_BLOCKS /** * \brief Executes a block for each object. * * \param block The block to execute for each object Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -619,10 +619,20 @@ OFMutableArray *ret = [[self mutableCopy] autorelease]; [ret addObjectsFromArray: array]; [ret makeImmutable]; + return ret; +} + +- (OFArray*)arrayByRemovingObject: (id)object +{ + OFMutableArray *ret = [[self mutableCopy] autorelease]; + + [ret removeObject: object]; + [ret makeImmutable]; + return ret; } #ifdef OF_HAVE_BLOCKS - (OFArray*)mappedArrayUsingBlock: (of_array_map_block_t)block