Cercando di chiamare dispatch_time a Swift sta facendo la mia testa in, ecco perché:Come si trasmette un UInt64 a un Int64?
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 10 * NSEC_PER_SEC), dispatch_get_main_queue(), {
doSomething()
})
genera l'errore: "Impossibile trovare un sovraccarico di '*' che accetta gli argomenti forniti".
NSEC_PER_SEC è un tempo UInt64 così per alcuni esperimenti:
let x:UInt64 = 1000
let m:Int64 = 10 * x
Risultati nella stessa errore come sopra
let x:UInt64 = 1000
let m:Int64 = 10 * (Int64) x
Risultati in "dichiarazioni consecutive su una linea devono essere separati da ';' "
let x:UInt64 = 1000
let m:Int64 = 10 * ((Int64) x)
Risultati in" Expected '' separatore"
let x:UInt64 = 1000
let m:Int64 = (Int64)10 * (Int64) x
Risultati in "dichiarazioni consecutivi su una linea devono essere separati da ';'"
ecc ecc
Accidenti a te compilatore Swift, mi arrendo. Come faccio a trasmettere un UInt64 a Int64 e/o come usi dispatch_time in swift?
Grazie, facile una volta che sai – Gruntcakes
Infatti! :) - è un cambio di mente ... – Grimxn
Invece di moltiplicare per 10, puoi semplicemente moltiplicare per uno? – Bill