Reputation: 13
I have NSMutableArray with 10,000 objects, each object has Name, Details, ...etc. I want to Create an NSArray Which contains ONLY the Names of all objects.
NSMutableArray
NSArray
Upvotes: 0
Views: 264
Reputation: 38728
Use KVC
NSArray *names = [myArray valueForKey:@"name"];
Check the docs for NSArray
valueForKey: Returns an array containing the results of invoking valueForKey: using key on each of the array's objects.
Upvotes: 7