iphone - Not able to display anything on table view Swift -


this history view, have tableview inside view controller. reason can't output anything, trying hardcode , not displaying @ all. 1 thing know need make tableview functions override , if error.

  import uikit      class history: uiviewcontroller, uitableviewdatasource, uitableviewdelegate     {      @iboutlet var tableview: uitableview!      override func viewdidload()     {         super.viewdidload()          tableview.delegate = self         tableview.datasource = self          self.view.backgroundcolor = uicolor(patternimage: uiimage(named: "newbackground.jpg")!)     }      func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int {         return 1     }       func numberofsectionsintableview(tableview: uitableview) -> int {         return 1     }       func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell     {         let cell = tableview.dequeuereusablecellwithidentifier("historycell", forindexpath: indexpath) as! historycell          cell.durationlabel.text = "98"          return cell     }       override func viewwillappear(animated: bool)     {         super.viewwillappear(animated)      }  } 

heres class cell prototype, , made sure identifier "historycell"

public class historycell: uitableviewcell{     @iboutlet var durationlabel: uilabel!     @iboutlet var kickslabel: uilabel!  } 

how did connect prototype cell's controls iboutlets in historycell class ? didn't know possible when you're not using uitableviewcontroller. i've been using tags time.

unless there's new wasn't aware of, assignment cell.durationlabel.text should cause unwrapping of nil (is error you're getting ?)


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 -