Pooja
Pooja

Reputation: 2200

copy NSMutableArray atIndex (0) to other NSMutable index (0)

i have 2 array 1st array if full
2nd array is empty
i want to copy only 1st array value at index 0 to 2nd array at index 0

is it possible?

thank u in advance

Upvotes: 0

Views: 422

Answers (2)

Pooja
Pooja

Reputation: 2200

secondArrayValue = [[NSMutableArray alloc]initWithArray:ArrayValue copyItems:YES];

This works for me.

Upvotes: 1

Alexsander Akers
Alexsander Akers

Reputation: 16024

[array2 insertObject: [array1 objectAtIndex: 0u] atIndex: 0u]

Upvotes: 2

Related Questions