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

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -