0
私はこれを私のコードに入れました。オプションの値をアンラップする方法は?
let hex:String = "#FFFFFF"
var returnValue = UInt()
var newString = String()
newString = hex.replacingOccurrences(of: "#", with: "0x")
returnValue = UInt(newString)! //This line gets an error
アンラッピングするオプションの値のエラーが表示されます。どうすれば修正できますか?
スウィフト3 Xcodeのバージョンは、」致命的なエラーがない[何の8 –
可能な重複しています任意の値をアンラッピングしながら "平均?"(http://stackoverflow.com/questions/32170456/what-does-fatal-error-unexpectedly-found-nil-while-unwrapping-an-optional-valu) – Hamish