casillas
casillas

Reputation: 16793

Filtering in NSMutableArray

I have the following NSMutableArray called test.

I wonder how could I able to filter only comboItemNames from the following object?

enter image description here

I could able to write a for loop to iterate each comboItemNames as follows, but I am looking for better way.

NSMutableArray * names = [[NSMutableArray alloc]initWithCapacity:10];
for (id t in test)
{
    [names addObject:((ComboItemPopOver*)t).comboItemNames];
}

Upvotes: 0

Views: 102

Answers (1)

bbum
bbum

Reputation: 162712

[test valueForKey:@"comboItemNames"];

Upvotes: 2

Related Questions