0

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.

1 Answer 1

7

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.