Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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?
Yes, you can use [mutableArray addObjectsFromArray: otherArray]
[mutableArray addObjectsFromArray: otherArray]
Add a comment
There's an addObjectsFromArray: method in NSMutableArray. Works?
addObjectsFromArray:
NSMutableArray
Sure
addObjectsFromArray: your NSArray
I don't know how many cycles this takes, but you can add object from an array with addObjectsFromArray.
[mainMutableArray addObjectsFromArray:anotherArray];
Required, but never shown
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.
Explore related questions
See similar questions with these tags.