I have a mutable array that has a range of numbers (that are changed dynamically later on if that helps), I grab a random number's index from that array and want to stick it in another array (also mutable). I'm not sure how to grab the object at a certain index and copy it.
Here's what I tried to do:
[btnRange addObject:@"12"];
[btnRange addObject:@"13"];
[btnRange addObject:@"14"];
[btnRange addObject:@"17"];
[btnRange addObject:@"18"];
[btnRange addObject:@"19"];
//start randomising and adding to btnOrder Array
for (NSInteger i=0; i <= 5; i++) {
id nxt = btnRange[arc4random_uniform([btnRange count])];
[btnOrder addObject:(@"%@", nxt];
//[btnOrder addObject[btnRange(nxt)]; --didn't work
//[btnOrder addObjectsFromArray:(btnRange. nxt]; --didn't work
//[btnOrder addObject:nxt]; --didn't work (I'm pretty new to this)
}
How can I take the object at a specific index of the first array and copy it over at the end of the second array?