swift文档上有一句:
注意:
如果你在隐式解析可选类型没有值的时候尝试取值,会触发运行时错误。和你在没有值的普通可选类型后面加一个惊叹号一样。
那么为啥
let str: String! = nil
println("str get (str)")
这样写不会报错呢?
swift文档上有一句:
注意:
如果你在隐式解析可选类型没有值的时候尝试取值,会触发运行时错误。和你在没有值的普通可选类型后面加一个惊叹号一样。
那么为啥
let str: String! = nil
println("str get (str)")
这样写不会报错呢?