swift - UILabel Value of type 'String' have no member 'text' (Static Custom Cell) -


i'm getting user information json when assign values labels, shows error (value of type 'string' have no member 'text').

is because custom static table cell? how fix it? foundation not good...

enter image description here
and:

enter image description here

use different variable names. practise have unique variable names

as variable names same variable values getting error

uilabel has name empnamelabel : uilabel(in viewdidload) , value has same name.

change

let empnamelabel = user!["crew_name"] as? string //conflicting name uilabel iboutlet 

to

let empnamevalue = user!["crew_name"] as? string //variable name unique 

also should not force unwrap options(user in case)

it should

var empnamevalue = "" if let unwrappeduser = user {     if let empnamevalue = unwrappeduser["crew_name"] as? string {         empnamelabel.text = empnamevalue //assign value uilabel     } } 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -