tester
tester

Reputation: 77

How to bind 2 NSMutableArray?

i have 2 NSMutableArray with same type. i want to add second nsmutablearray to first one.

NSMutableArray *tmpArray1 (10 objects in it)

NSMutableArray *tmpArray2 (10 objects in it)

if i use [tmpArray1 addobject:tmparray2]; tmpArray1's count goes to 11. but i want to append tmparray2 to firstone. count must be 20.

thanks...

Upvotes: 0

Views: 85

Answers (2)

Toastor
Toastor

Reputation: 8990

Try this:

[tmpArray1 addObjectsFromArray:tmparray2];

Upvotes: 1

kennytm
kennytm

Reputation: 523574

Use -addObjectsFromArray: to extend a array by another.

[tmpArray1 addObjectsFromArray:tmpArray2];

Upvotes: 0

Related Questions