Is there any way to do addObjectFromArray:atIndex:?
I have 2 NSMutableArrays. Lets say 1st array is array1 and the 2nd is array2. They ar filled with values. And I need to add item from array1 at index 3 to array2. Is it possible?
Is there any way to do addObjectFromArray:atIndex:?
I have 2 NSMutableArrays. Lets say 1st array is array1 and the 2nd is array2. They ar filled with values. And I need to add item from array1 at index 3 to array2. Is it possible?
We have addObjectsFromArray: method it means,adds the objects contained in another given array to the end of the receiving array’s content.
But we don't have addObjectFromArray:atIndex: method. For getting your results, you can use methods what NSMutableArray class contains.
[array2 addObject: [array1 objectAtIndex: index3]];
Here we can use two methods addObject: and objectAtIndex:. For more details, use this link.