Ich bin verwirrt, was los ist Ich mache ein Tutorial über Sammlung Ansichten, wie ich ziemlich neu in der Programmierung bin, und ich glaube, ich mache alles richtig, aber ich werde -[UIView tableView:numberOfRowsInSection:]: unrecognized selector sent to instance
getroffen . HierUITableView unerkannter Selektor an Instanz gesendet
ist das Tutorial: http://www.thorntech.com/2015/08/want-your-swift-app-to-scroll-in-two-directions-like-netflix-heres-how/
import UIKit
class ViewController: UIViewController, UITableViewDataSource {
var categories = ["Action", "Drama", "Science Fiction", "Kids", "Horror"]
func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
return categories[section]
}
func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return categories.count
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("cell") as! CategoryRow
return cell
}
Es hat funktioniert! Danke, dass ich meine Datenquelle auf die Tabellenansicht direkt anstelle der Viewcontroller gesetzt – Hightower98
herzlich willkommen bro –