可能性の重複:
canonical way to randomize an NSArray in Objective Ciphone:どのようにランダムに配列の要素を移動するための
次のように私は配列を持っていると仮定します。
shuffleArray = [[NSMutableArray alloc] initWithObjects:@"A",@"B",@"C",@"D",@"E", nil];
と私は次のようにランダムに配列の要素の位置を変更したい:
shuffleArray = [[NSMutableArray alloc] initWithObjects:@"C",@"A",@"B",@"E",@"D", nil];
は、私はこれをどのように行うことができます。
事前に
ありがとう..
このリンクに従うことができます:http://stackoverflow.com/questions/4349669/nsmutablearray-move-object-from-index-to-index –
this http://stackoverflow.com/questions/5659718/shuffling-目的の配列の配列を使用すると問題を解決できます –