Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私のアプリケーションでは、ユーザーに番号を入力してもらい、その番号が入力されると、画面上の割り当てられたスペースに応答を送信します。ランダムに生成された複数の回答を指定した領域に保存するにはどうすればよいですか?
を作成し、NSMutableArrayそこに数字を追加します。
NSMutableArray
NSMutableArray *array = [[NSMutableArray alloc] init]; //add the number [array addObject: number];
これで、配列からランダムに数字を選択して表示できます。
int number = [array objectAtIndex: 1];