swift - Error: 'String' is not convertible to 'String!' -
mapview.rac_valuesforkeypath("usertrackingmode", observer: self).subscribenextas { // block handling
i error 'string' not convertible 'string!'
. suggestions may mean?
i used think, string!
same string
, unwrapped string?
...
- xcode 7.3.1
- swift 2.2
- reactivecocoa 4.1.0
i think compiler reporting wrong error.
you can simplify expression using
let key: string! = "usertrackingmode"
and use key
instead of literal.
that simplify expression , compiler print real error.
type inferring complicated , when compiler doesn't find valid type combination, can show wrong error.
Comments
Post a Comment