【发布时间】:2014-11-26 09:05:14
【问题描述】:
在 Swift Xcode 6.1 中为 UITableView 编写简单代码时出现以下错误
/Users/classic/Documents/CIPL/Demo Projects/DemoTableView/DemoTableView/ViewController.swift:11:1: Type 'ViewController' does not conform to protocol 'UITableViewDataSource'
/Users/classic/Documents/CIPL/Demo Projects/DemoTableView/UIKit.UITableViewDataSource:3:48: Protocol requires function 'tableView(_:cellForRowAtIndexPath:)' with type '(UITableView, cellForRowAtIndexPath: NSIndexPath) -> UITableViewCell'
有人知道为什么会出现这个问题吗?
【问题讨论】:
-
您是否在 Storyboard 中将 TableViewController 定义为 UITableViewcontroller 的子类?