07-21-2023, 08:33 PM
I have an `NSArray` and I'd like to create a new `NSArray` with objects from the original array that meet certain criteria. The criteria is decided by a function that returns a `BOOL`.
I can create an `NSMutableArray`, iterate through the source array and copy over the objects that the filter function accepts and then create an immutable version of it.
Is there a better way?
I can create an `NSMutableArray`, iterate through the source array and copy over the objects that the filter function accepts and then create an immutable version of it.
Is there a better way?