ios - Format String to NSString in swift -
i'm trying set tableviewcell properties different labels. keep getting errors regarding strings. i've started hooking array this.
cell.titleviewlabel.text = arraynews[indexpath.row].title however keep getting error
cannot assign value of type nsstring value of type string how can format above title nsstring don't error in cellforrowatindexpath? or due else?
problem:
the root of problem follows:
cell.titleviewlabel.text nsstring
arraynews[indexpath.row].title string
solution:
you need cast string nsstring. try following syntax
cell.titleviewlabel.text = arraynews[indexpath.row].title nsstring
Comments
Post a Comment