ios - Ambiguous reference to member '(_:numberOfRowsInSection:)' -
i'm trying get
gists github , pop them in table view, here's entire code, gist
class defined elsewhere:
var gists = [gist]() override func viewdidappear(animated: bool) { loadgists() } func loadgists() { githubapimanager.sharedinstance.fetchpublicgists() { result in guard result.error == nil else { print("error 1") return } if let fetchedgists = result.value { self.gists = fetchedgists } self.tableview.reloaddata() //error here. } } func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int { return gists.count } func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell = tableview.dequeuereusablecellwithidentifier("cell")! let gist = gists[indexpath.row] cell.textlabel?.text = gist.description cell.detailtextlabel?.text = gist.ownerlogin return cell }
so, problem didn't add outlet of table view view controller.swift. dragged table view .swift file create it.
Comments
Post a Comment