0

So I have a nsarray (there will be lots of those) and I want to add its values to the main NSMutableArray. And I wonder is there any way to do this without using cycles?

4 Answers 4

3

Yes, you can use [mutableArray addObjectsFromArray: otherArray]

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

Comments

1

There's an addObjectsFromArray: method in NSMutableArray. Works?

Comments

0

Sure

addObjectsFromArray: your NSArray

Comments

0

I don't know how many cycles this takes, but you can add object from an array with addObjectsFromArray.

[mainMutableArray addObjectsFromArray:anotherArray];

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.