for an iOS 5.0 application using ARC, i have an NSArray of objects that contain NSArray of other objects within it. Is it possible to extract a list of objects from inner arrays without iterating through the Array e.g. say, with NSpredicate or valueForKeyPath. To be clearer, I have:
NSArray *objtype1 contains
-id
-NSArray *imageObjs containing imageObjects
-imagetype = 1 <--1st imageObject
imageURL1
-imagetype = 2 <--2nd imageObject
imageURL2
-NSArray *objtype2
-other parameters
I need to extract the NSArray of imageType = 1 imageObjects to pass in for further processing. Is this possible? (I’m looking at NSpredicate, and valueForKeyPath, but have not found anything yet)
I think the reason you haven’t found anything yet is because it’s not there. You could implement your own category on
NSArrayto use predicates recursively. Perhaps someone else have done it already. I don’t know.