swift UITableView的使用方法?


图片描述

求解。

ios swift

ever17 10 years, 3 months ago

解决办法:因为UITableView的一些协议没有实现

Spprite answered 10 years, 3 months ago

你必须实现这几个协议的required方法


 func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return 10
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCellWithIdentifier("cell")
    return cell!
}

上條·當麻 answered 10 years, 3 months ago

Your Answer