views:

45

answers:

1

I have an array that it is populated by core data as follows.

NSMutableArray *mutableFetchResults = [CoreDataHelper getObjectsFromContext:@"Spot" :@"Name" :YES :managedObjectContext];

It looks like this in the console.

(entity: Spot; id: 0x4b7e580 ; data: { CityToProvince = 0x4b7dbd0 ; Description = "Friend"; Email = "[email protected]"; Age = 21; Name = "Adam"; Phone = "+44175240"; }),

How can i filter the array to remove anyone who is over a certain age? or use values in the array to make calculations?

Please help i have been stuck for ages on this. Code would be gratefully appreciated.

+1  A: 

You construct an NSPredicate and then call -filteredArrayUsingPredicate: upon the array to get back a filtered array.

Marcus S. Zarra
Thanks for another great Core-Data answer marcus. Helped me implement filtering in my table-view with ease.
David Barry