ios - How to display content to cell using textLabel.text to a TableView object in Swift -


i want add simple string textlabel.text property display in cells in example.

i added number of sections, number of rows in section, , trying display data cells.

import uikit  class viewcontroller: uiviewcontroller, uitableviewdatasource {  // number of sections in table view func numberofsectionsintableview(tableview: uitableview) -> int {     return 1 }  // number of rows in section func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int {     return 5 }  // returns content of each row func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell {     // object represent each cell     var cell = uitableviewcell()     // configure     cell.textlabel?.text? = "hello"       - run problem     //cell.textlabel?.text = "hello"      - run problem     return cell } 

the viewcontroller not configured delegate.


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -