{"title":"String(format: "%016d", arc4random_uniform(999999999999999))\nInteger literal '999999999999999' overflows when stored into 'UInt32'\n报错内容:报错的原因是整数999999999999999超出了UInt32的范围。UInt32的最大值是4294967295。所以需要使用更大范围的整数类型来存储999999999999999,例如UInt64。修改代码如下:\n\nString(format: "%016d", arc4random_uniform(UInt32(UInt64.max)))

Swift: 解决“Integer literal '999999999999999' overflows when stored into 'UInt32'”错误

原文地址: https://www.cveoy.top/t/topic/pUFh 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录