This might be a basic question, but I am not getting any efficient way to do this. Suppose I have an array of multiple objects containing multiple key value like this. Now, I want the total count of grActual whose value is 16- Jan-13.I can iterate the array, and create a new array with key grAcutal and then I can count. Is there any other way to do that?
(
{
gIActual = "17-Jan-13";
grActual = "16-Jan-13";
},
{
gIActual = "18-Jan-13";
grActual = "16-Jan-13";
},
{
gIActual = "16-Jan-13";
grActual = "16-Jan-13";
},
{
gIActual = "16-Feb-13";
grActual = "16-Jan-13";
})
NSArray *filteredarray = [array filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"(grActual == %@)", @"16- Jan-13"]];which will give you number of objects in the array, the total count of the array would be the Count you need.