Force Shuffle NSMutableArray

前端 未结 6 965
深忆病人
深忆病人 2021-01-13 14:03

I have a NSMutableArray called putNumberUsed. It contains the following objects @\"blah1,@\"blah2\",@\"blah3\",@\"blah4\". I want to shuffle these objects randomly so for ex

6条回答
  •  终归单人心
    2021-01-13 14:39

    You can shuffle the object by using the following line of code,

    [putNumbersUsed exchangeObjectAtIndex:3 withObjectAtIndex:0];
    

    I think this may useful to you.

提交回复
热议问题