How to generate random uppercase characters in Objective-C

后端 未结 3 892
清歌不尽
清歌不尽 2021-02-11 06:45

How can I generate 20 Uppercase characters randomly in my Objective-C iOS app?

3条回答
  •  误落风尘
    2021-02-11 07:36

    char c = (char)('A' + arc4random_uniform(25))

    Will give you a random uppercase character.

提交回复
热议问题