你如何将UInt64.max转换为Swift中的字符串?
你如何将UInt64.max转换为Swift中的字符串?
这个问题已经在此处有答案:
我正在尝试将UInt64.max
转换为String
。
像这样的一行:
var str: String = UInt64.max
在XCode中引起错误:
'UInt64' is not convertible to 'String'
另一例子,像以下的行:
let strFromUInt: String = NSNumber(unsignedLongLong: UInt64.max)
在XCode中也会引起错误:
'NSNumber' is not convertible to 'String'
如果我有什么遗漏,对于iOS开发还是很新手,谢谢!
admin 更改状态以发布 2023年5月24日