scroll - tableViewUi cell subtitle shows sometime -


i having issue uitableviewcell. when table view loads, of cell not have subtitle. aldy set style of cell subtitle. weird part when scroll , down, missing parts appear again other cells missing table subtitle. here code cellforrowatindexpath

let cell = tableview.dequeuereusablecellwithidentifier(cellidentifier, forindexpath: indexpath) as! uitableviewcell     cell.layoutmargins = uiedgeinsetszero     cell.preservessuperviewlayoutmargins = false     let polist = self.polist[indexpath.row]     if(polist.poshort == "header"){         cell.backgroundcolor = sharedclass().coopgroupheadercolor         let selectedcolor = uiview()         selectedcolor.backgroundcolor = sharedclass().coopgroupheadercolor         cell.selectedbackgroundview = selectedcolor         cell.textlabel?.textcolor = uicolor.blackcolor()         cell.textlabel?.font = uifont.boldsystemfontofsize(18.0)         cell.textlabel?.textalignment = .left         cell.accessorytype = .none         let t_header = "program office"         cell.textlabel?.text = t_header         cell.detailtextlabel?.text = ""         cell.userinteractionenabled = false;     }     else{         cell.backgroundcolor = indexpath.row % 2 == 0 ? uicolor.clearcolor() : sharedclass().cellbackgroundcolor         let selectedcolor = uiview()         selectedcolor.backgroundcolor = sharedclass().selectedcellcolor         cell.selectedbackgroundview = selectedcolor         cell.textlabel?.font = uifont.boldsystemfontofsize(11.0)         cell.textlabel?.textcolor = uicolor.blackcolor()         if(polist.poshort != "other" && polist.poshort != "invalid" && polist.poshort != "all"){             cell.textlabel?.text = polist.poname + " - " + polist.poshort         }         else{             cell.textlabel?.text = polist.poname         }         let cellvalue = "total number of staff not responded - " + polist.totalusers         cell.detailtextlabel?.text = cellvalue         if(polist.totalusers == "0"){             cell.userinteractionenabled = false;             cell.accessorytype = .none         }         else{             cell.accessorytype = uitableviewcellaccessorytype.disclosureindicator         }     }       return cell 

and result, cells missing subtitle not perform push segue either.

please help.

thank you.

may issue - not setting value in following if statement:

if(polist.poshort == "header"){      ......     .......     cell.detailtextlabel?.text = ""   <<<<<<<<     ...... 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -