NSArray(BMKitAdditions) Category Reference
Declared in | NSArray+BMKitAdditions.h |
Tasks
Querying an Array
-
– firstObject
Returns the object in the array with the lowest index value.
Performing Blocks on Elements
-
– makeObjectsPerformBlock:
Performs the block on each object in the array, starting with the first object and continuing through the array to the last object.
Deriving New Arrays
-
– filteredArrayUsingPredicateBlock:
Evaluates a given predicate block against each object in the receiving array and returns a new array containing the objects for which the predicate block returns true.
-
– transformedArrayUsingTransformator:
Invokes the transformator on each object in the receiving array and returns a new array containing the transformed objects.
Instance Methods
filteredArrayUsingPredicateBlock:
Evaluates a given predicate block against each object in the receiving array and returns a new array containing the objects for which the predicate block returns true.
- (NSArray *)filteredArrayUsingPredicateBlock:(BMPredicateBlock)predicateBlock
Parameters
- predicateBlock
The predicate block against which to evaluate the receiving arrayâs element
Return Value
A new array containing the objects in the receiving array for which predicateBlock returns true.
Declared In
NSArray+BMKitAdditions.h
firstObject
Returns the object in the array with the lowest index value.
- (id)firstObject
Return Value
The object in the array with the lowest index value. If the array is empty, returns nil
.
Declared In
NSArray+BMKitAdditions.h
makeObjectsPerformBlock:
Performs the block on each object in the array, starting with the first object and continuing through the array to the last object.
- (void)makeObjectsPerformBlock:(BMTargetBlock)aBlock
Parameters
- aBlock
A block to invoke with the objects in the array. The block must not have the side effect of modifying the receiving array.
Discussion
This method raises NSInvalidArgumentException
if aBlock is nil
.
Declared In
NSArray+BMKitAdditions.h
transformedArrayUsingTransformator:
Invokes the transformator on each object in the receiving array and returns a new array containing the transformed objects.
- (NSArray *)transformedArrayUsingTransformator:(BMTransformator)aTransformator
Parameters
- aTransformator
The transformator to invoke on the receiving array’s elements.
Return Value
A new array containing the transformed objects in the receiving array.
Declared In
NSArray+BMKitAdditions.h