How to return objects in an NSArray at specified indexes?

Posted by wgpubs on Stack Overflow See other posts from Stack Overflow or by wgpubs
Published on 2010-04-14T20:11:10Z Indexed on 2010/04/14 20:13 UTC
Read the original article Hit count: 215

Filed under:
|

Example:

I have an NSArray with 40 objects. What is the most efficient way to return ONLY those objects with index equal to a number specified in another NSArray (e.g {0, 27, 36} for example)?

Can a predicate be used here? Or is there a more simple and efficient approach?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about nsarray