18 OF_ASSUME_NONNULL_BEGIN
44 #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
45 # define ObjectType id
54 + (instancetype)arrayWithCapacity: (
size_t)capacity;
63 - (instancetype)initWithCapacity: (
size_t)capacity;
70 - (void)addObject: (ObjectType)object;
77 - (void)addObjectsFromArray: (
OFArray OF_GENERIC(ObjectType) *)array;
85 - (void)insertObject: (ObjectType)object atIndex: (
size_t)index;
93 - (void)insertObjectsFromArray: (
OFArray OF_GENERIC(ObjectType) *)array
94 atIndex: (
size_t)index;
103 - (void)replaceObject: (ObjectType)oldObject withObject: (ObjectType)newObject;
111 - (void)replaceObjectAtIndex: (
size_t)index withObject: (ObjectType)object;
123 - (void)setObject: (ObjectType)object atIndexedSubscript: (
size_t)index;
132 - (void)replaceObjectIdenticalTo: (ObjectType)oldObject
133 withObject: (ObjectType)newObject;
140 - (void)removeObject: (ObjectType)object;
148 - (void)removeObjectIdenticalTo: (ObjectType)object;
155 - (void)removeObjectAtIndex: (
size_t)index;
162 - (void)removeObjectsInRange: (
of_range_t)range;
174 #ifdef OF_HAVE_BLOCKS
189 - (void)exchangeObjectAtIndex: (
size_t)index1 withObjectAtIndex: (
size_t)index2;
207 - (void)sortUsingSelector: (
SEL)selector options: (
int)options;
209 #ifdef OF_HAVE_BLOCKS
220 - (void)sortUsingComparator: (
of_comparator_t)comparator options: (
int)options;
232 #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
237 OF_ASSUME_NONNULL_END
id _Nonnull(^ of_array_replace_block_t)(id object, size_t index)
A block for replacing values in an OFMutableArray.
Definition: OFMutableArray.h:30
of_comparison_result_t(^ of_comparator_t)(id _Nonnull left, id _Nonnull right)
A comparator to compare two objects.
Definition: OFObject.h:74
An abstract class for storing objects in an array.
Definition: OFArray.h:92
An abstract class for storing, adding and removing objects in an array.
Definition: OFMutableArray.h:44
void removeLastObject()
Removes the last object.
Definition: OFMutableArray.m:371
void makeImmutable()
Converts the mutable array to an immutable array.
Definition: OFMutableArray.m:452
void removeAllObjects()
Removes all objects.
Definition: OFMutableArray.m:381
void sort()
Sorts the array in ascending order.
Definition: OFMutableArray.m:413
void reverse()
Reverts the order of the objects in the array.
Definition: OFMutableArray.m:441
A range.
Definition: OFObject.h:93