0
Я пытаюсь GET
г из Github и совать их в виде таблицы, вот весь код, Gist
это класс, определенный в другом месте:Неоднозначность ссылки на член «(_: numberOfRowsInSection :)»
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
}
http://stackoverflow.com/questions/37152014/tableview-reloaddata-error-ambiguous-reference-to-member Это должно помочь. –
Да, вы правы @ АнтонТарасов –