ios - Cannot subscript a value of type '[String: AnyObject]' with an index of type 'String' -


this not duplicate of question

cannot subscript value of type '[nsobject : anyobject]?' index of type 'string'

or

cannot subscript value of type '[string : string]?' index of type 'string'

the reason because dictionary not optional, problem question. why can't subscript this...

enter image description here

accessing dictionaries subscript returns optional. because can't tell dictionary going use subscript exists in keys list. (even if could, wouldn't believe :).


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -