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.
Obj-C で数字の並びをランダムに並べる方法を教えてください。たとえば、1 ~ 4 の場合、3、1、2、4 または 1、4、3、2 になります。私はそれがこの機能を含むことを知っていますarc4random()。提案/ヒントはありますか?
arc4random()
ここでは、 のシャッフル カテゴリを見つけることができますNSMutableArray。
NSMutableArray
NSMutableArray をシャッフルする最良の方法は何ですか?
を使用できint iRandomNum = arc4random() % 4、それに応じて for ループで出力を使用できます
int iRandomNum = arc4random() % 4