forum

home / developersection / forums / filtering nsarray into a new nsarray in objective-c

filtering NSArray into a new NSArray in objective-c

Anonymous User 2175 22-Aug-2015

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?


Updated on 22-Aug-2015

I am a content writter !

Can you answer this question?

Answer

1 Answers

Liked By