我需要将标签的更改文本保存为变量,但如果编写以下代码:
var warn = Int(self.dyn.text)
它说:
Value of optional type 'String?' must be unwrapped to a value of type 'String'
Coalesce using '??' to provide a default when the optional value contains 'nil'
Force-unwrap using '!' to abort execution if the optional value contains 'nil'
我应该使用什么代码?