ios - How to alter tableview cell text? -


i have uitableview want alter of static cells after other processing. have outlets set cells want modify, when @ them using nslog, show nil, indicates me don't have correct cell. instance, in image below want add start time label did date (date done when creating cells got current date),

enter image description here

i tap on disclosure indicator takes me scene (this created in storyboard, using segues 1 scene another) 2 times need. return main scene (shown) , try alter start time label, nothing happens. nslog of label prior trying alter returns this:

ostarttimecell.textlabel.text: (null)

i have read in 1 of apple docs textfield read-only. if true in case, there way can reload cells updated information? or there way this?

you're using wrong approach. should not create reference cell using outlet. once cell moves out of visible view, outlet either null or contain garbage data. if (in situation) cell never move out of view, think shows you're trying use uitableview in way not meant be.

instead put data want display in cells in datasource, e.g. array.

the tableview should use datasource configure values displayed in textlabels of cells. once want update text displayed in cells, change values in datasource , call reloaddata on tableview force tableview call -tableview:cellforrowatindexpath: , related uitableviewdatasource methods.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -