【发布时间】:2016-02-05 20:45:02
【问题描述】:
我正在将 parse 中的数据附加到一个数组中,但是当我尝试在表视图中加载数组时,什么都没有显示。数组已填充,但没有显示任何内容。我该如何解决这个问题?
class View2: UIViewController, UITableViewDataSource, UITableViewDelegate{
var ret = [String]()
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return ret.count
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = table.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath)
cell.textLabel?.text = ret[indexPath.row]
return cell
}
}
【问题讨论】:
-
var ret = [String]()这一行在哪里?你的 ret 有什么?你能告诉我们吗?
标签: ios arrays swift uitableview deque