@@ -180,17 +180,42 @@ - (void)addObject: (id)object { [self insertObject: object atIndex: [self count]]; } + +- (void)addObjectsFromArray: (OFArray*)array +{ + [self insertObjectsFromArray: array + atIndex: [self count]]; +} - (void)insertObject: (id)object atIndex: (size_t)index { @throw [OFNotImplementedException exceptionWithClass: isa selector: _cmd]; } + +- (void)insertObjectsFromArray: (OFArray*)array + atIndex: (size_t)index +{ + OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; + OFEnumerator *enumerator = [array objectEnumerator]; + size_t i, count = [array count]; + + for (i = 0; i < count; i++) { + id object = [enumerator nextObject]; + + assert(object != nil); + + [self insertObject: object + atIndex: index + i]; + } + + [pool release]; +} - (void)replaceObjectAtIndex: (size_t)index withObject: (id)object { @throw [OFNotImplementedException exceptionWithClass: isa