- 897 名前:デフォルトの名無しさん mailto:sage [2010/05/18(火) 10:55:35 ]
- NSInteger index = random() % count;
NSInteger index2 = random() % count; while(index2 == index) {//同じにならないように NSInteger index2 = random() % count; // このindex2と前のindex2は別物 } 一つ目のindex2と二つ目のindex2は別物です。 while(index2 == index) {//同じにならないように index2 = random() % count; // 宣言しない } としてください。 // 変数が隠されてしまっている とか警告出ませんでした? // 変数スコープとかその辺の話も調べてね
|

|