【问题标题】:how to generate random string with arc4random in swift?? It is possible?如何在 swift 中使用 arc4random 生成随机字符串?有可能的?
【发布时间】:2017-01-16 16:00:55
【问题描述】:

【问题讨论】:

标签: swift arc4random


【解决方案1】:

您必须将 arc4random 的结果限制为数组的长度。

array1[Int(arc4random_uniform(UInt32(array1.count)))]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-27
    • 2011-09-26
    • 2015-12-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多