如何将UInt64转换为Int64?

时间:2014-08-29 18:51:09

标签: compiler-errors swift type-conversion numeric-conversion

此函数调用的第二个参数:

dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC)

导致编译器错误:

'UInt64' is not convertible to 'Int64'

快速参考

func dispatch_time(when: dispatch_time_t, delta: Int64) -> dispatch_time_t

var NSEC_PER_SEC: UInt64 { get } /* nanoseconds per second */

1 个答案:

答案 0 :(得分:0)

请参阅:How do you cast a UInt64 to an Int64?在搜索编译器错误时,该问题无法显示:'UInt64' is not convertible to 'Int64'