swift - 'anyObject' is not convertible to 'Dictionary<key, value>]' -
hi want object type dictionary using nsuserdefaut :
var favoriteplace = nsuserdefaults.standarduserdefaults().objectforkey("saveplace")! [dictionary]
but error 'anyobject' not convertible 'dictionary]'
i try :
var favoriteplace = nsuserdefaults.standarduserdefaults().objectforkey("saveplace")! [dictionary<string, string>()]
but it's not work, too. know how can ? !
both tries syntax errors.
to cast dictionary: dictionary<type, type>
or [type : type]
so doing
var favoriteplace = nsuserdefaults.standarduserdefaults().objectforkey("saveplace")! [[string: string]]
or
var favoriteplace = nsuserdefaults.standarduserdefaults().objectforkey("saveplace")! [dictionary<string, string>]
Comments
Post a Comment